{
"path": "/projects/bluesky-moon-tracker",
"site": "at://did:plc:ofrbh253gwicbkc5nktqepol/site.standard.publication/3mfyq5mpohw25",
"tags": [
"ai",
"atproto",
"bots",
"rust"
],
"$type": "site.standard.document",
"title": "bluesky-moon-tracker",
"description": "A Bluesky bot that posts daily moon phase updates with a lycanthropic twist. Optional Ollama LLM generation.",
"publishedAt": "2026-04-11T00:00:00.000Z",
"textContent": "bluesky-moon-tracker is a Rust bot that posts daily moon phase updates to Bluesky at 00:00 UTC. Messages are tailored to the lunar phase and current month, with a lycanthropic flavour, British references, and occasional Pride references in June.\n\nBuilt with atrium-rs for AT Protocol, compiled to a ~3 MB static binary with rustls-tls (no OpenSSL).\n\nMoon Phase Data\n\nThe bot fetches moon phase data from multiple sources with automatic fallback:\n\n1. Skytime — free, no auth, 60 req/min\n2. Farmsense — free, no auth\n3. Local calculation — pure-math Meeus synodic period algorithm, no network dependency\n\nIf all APIs are down, the local calculation ensures the bot can still post. Accuracy is ±1 day for phase boundaries, ±5% for illumination — good enough for a daily bot.\n\nOllama LLM Generation\n\nSet OLLAMA_MODEL to generate unique posts via a local Ollama LLM instead of the built-in template system.\n\nThe LLM is prompted with the moon phase, illumination, month, and the bot's personality (lycanthropic, British, pagan). If Ollama fails or times out, the bot falls back to templates.\n\nSetup\n\nCreate .env (or copy .env.example):\n\nRun:\n\nIf the current time is past 00:00 UTC, the bot posts immediately and then schedules the next post for the following day.\n\nSetting DEBUG_MODE=true with credentials causes an immediate test post; without credentials it logs all possible message combinations to the console instead.\n\nStructure\n\n- src/main.rs — Entry point, env loading, debug/production mode\n- src/config.rs — Environment variable parsing\n- src/bluesky.rs — Authentication and posting via atrium-api\n- src/scheduler.rs — UTC midnight sleep loop with graceful shutdown\n- src/moon/constants.rs — Phase enum, emojis, hashtags, phrase banks\n- src/moon/calc.rs — Local moon phase calculation (Meeus algorithm)\n- src/moon/api.rs — Multi-source moon phase fetching (Skytime → Farmsense → Local)\n- src/moon/messages.rs — Message generation (Ollama → template fallback)\n\nLicence\n\nMIT.",
"canonicalUrl": "https://docs.ewancroft.uk/projects/bluesky-moon-tracker"
}