- persist post and thumbnail cooldowns to shared JSON state - check global cooldown before login and before posting - stop parallel workers from repeatedly hitting createRecord after first 429 - add clear post start/success/failure/global-cooldown logs - reduce traceback noise for expected rate-limit failures
post2bsky
post2bsky is a Python-based tool for automatically posting content from RSS feeds and Twitter accounts to Bluesky (AT Protocol). It supports both RSS-to-Bluesky and Twitter-to-Bluesky synchronization, with configurable workflows for various sources.
Features
- RSS to Bluesky: Parse RSS feeds and post new entries to Bluesky with proper formatting and media handling.
- Twitter to Bluesky: Scrape tweets from specified Twitter accounts and repost them to Bluesky, including media attachments.
- Daemon Mode: Run as a background service for continuous monitoring and posting.
- Configurable Workflows: Use YAML-based workflows to define sources, schedules, and posting rules.
- Media Support: Handle images, videos, and other media from feeds and tweets.
- Deduplication: Prevent duplicate posts using state tracking.
- Logging: Comprehensive logging for monitoring and debugging.
Installation
-
Clone the repository:
git clone https://github.com/yourusername/post2bsky.git cd post2bsky -
Install Python dependencies:
pip install -r requeriments.txt -
Set up environment variables: Create a
.envfile with your Bluesky credentials:BSKY_USERNAME=your_bluesky_handle BSKY_PASSWORD=your_bluesky_passwordFor Twitter scraping, additional setup may be required (see Configuration).
Configuration
RSS Feeds
Use rss2bsky.py to post from RSS feeds. Configure the feed URL and other options via command-line arguments.
Example:
python rss2bsky.py --feed-url https://example.com/rss --bsky-handle your_handle
Twitter Accounts
Use twitter2bsky_daemon.py for Twitter-to-Bluesky posting. It requires browser automation for scraping.
Configure Twitter accounts in the script or via environment variables.
Workflows
The workflows/ directory contains Jenkins pipeline configurations for automated runs. Each .yml file defines a pipeline for a specific source (e.g., 324.yml for 324 RSS feed).
To run a workflow manually, use the sync_runner.sh script or execute the Python scripts directly.
Usage
Running RSS Sync
python rss2bsky.py [options]
Options:
--feed-url: URL of the RSS feed--bsky-handle: Your Bluesky handle- Other options for filtering, formatting, etc.
Running Twitter Daemon
python twitter2bsky_daemon.py [options]
Options:
- Configure Twitter accounts and Bluesky credentials
- Run in daemon mode for continuous operation
Using Sync Runner
./sync_runner.sh
This script can be used to run multiple syncs or integrate with cron jobs.
Dependencies
All Python dependencies are listed in requeriments.txt. Key packages include:
atproto: For Bluesky API interactionfastfeedparser: For RSS parsingplaywright: For browser automation (Twitter scraping)beautifulsoup4: For HTML parsing- And many others for media processing, logging, etc.
License
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.
Contributing
Contributions are welcome! Please open issues or submit pull requests on GitHub.
Disclaimer
This tool is for personal use and automation. Ensure compliance with the terms of service of Bluesky, Twitter, and any RSS sources you use. Respect rate limits and avoid spamming.