I developed two automated systems that daily publish the **Astronomy Picture of the Day (APOD)** from NASA on different social media networks, each adapted to the technical specifications and best practices of each platform.
APOD on Instagram (@apodinsta)
This bot automatically publishes the daily APOD on Instagram, processing both images and videos with special formatting for each media type.
Main Features:
Media Detection: Identifies whether the APOD is an image, direct video, or embedded video (including YouTube links)
Video Processing:
Downloads videos from various sources including direct NASA links and YouTube
Processes videos to meet Instagram specifications (60s max, 1080p resolution)
Includes alternative methods when direct download fails
Caption Generation:
Uses the Google Gemini API to translate the English explanation into Brazilian Portuguese
Formats the caption appropriately for Instagram
Reliable Upload:
Implements mock systems for Instagram video upload requirements
APOD on Twitter/X and Bluesky (@nasapod and @nasapodsky)
This more sophisticated bot publishes on both Twitter/X and Bluesky simultaneously, with specific optimizations for each platform and thread support for long explanations.
Main Features:
Multi-platform Support:
Publishes on both Twitter (X) and Bluesky simultaneously
Formats content appropriately for each platform
Intelligent Content Handling:
For images: resizes and optimizes for each platform's specifications
For videos: downloads and crops to 140s for Twitter compatibility
For GIFs: preserves animation while optimizing file size
Threaded Explanations:
Splits long explanations into chained posts
Maintains conversation structure on both platforms
Accessibility:
Uses Gemini AI to generate descriptive alt text for images
Creates appropriate hashtags for discoverability
Historical Posts:
Can post random historical APODs (not just current day)
Special posting schedule at 7 AM for the current day's image
Technologies Used:
PythonTweepyBluesky APIFFmpegGoogle Gemini APINASA API