104 lines
3.3 KiB
Markdown
104 lines
3.3 KiB
Markdown
# 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
|
|
|
|
1. Clone the repository:
|
|
```bash
|
|
git clone https://github.com/yourusername/post2bsky.git
|
|
cd post2bsky
|
|
```
|
|
|
|
2. Install Python dependencies:
|
|
```bash
|
|
pip install -r requeriments.txt
|
|
```
|
|
|
|
3. Set up environment variables:
|
|
Create a `.env` file with your Bluesky credentials:
|
|
```
|
|
BSKY_USERNAME=your_bluesky_handle
|
|
BSKY_PASSWORD=your_bluesky_password
|
|
```
|
|
|
|
For 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:
|
|
```bash
|
|
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
|
|
```bash
|
|
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
|
|
```bash
|
|
python twitter2bsky_daemon.py [options]
|
|
```
|
|
|
|
Options:
|
|
- Configure Twitter accounts and Bluesky credentials
|
|
- Run in daemon mode for continuous operation
|
|
|
|
### Using Sync Runner
|
|
```bash
|
|
./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 interaction
|
|
- `fastfeedparser`: For RSS parsing
|
|
- `playwright`: 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](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. |