This open-source Go application automatically forwards posts from a Twitter/X account to Bluesky. It periodically checks for new tweets and posts them to your Bluesky account, including images and videos. This uses the twitter scraper from Imperatrona https://github.com/imperatrona/twitter-scraper to find tweets for a given account in the environment variables.
- Automatic tweet fetching from a specified X account
- Posts text content to Bluesky
- Uploads and embeds images and videos
- Configurable posting schedule via cron
- Duplicate post detection to avoid reposting
- Docker support for easy deployment to Dokploy, Coolify, and more.
- Testing
- Go 1.18 or later
- Twitter/X auth token and CSRF token (from Twitter Developer Dashboard)
- Bluesky account
Create a .env
file in the root directory with the following variables from the .env.example
file:
# Bluesky Credentials
HOST=https://bsky.social
HANDLE=your-bsky-handle.bsky.social
PASSWORD=your-bsky-password
# Twitter/X Credentials
AUTH_TOKEN=your-twitter-auth-token
CSRF_TOKEN=your-twitter-csrf-token
TWITTER_ACCOUNT=twitter-account-to-follow
# Optional Configuration
JOB_SPEC=* * * * *
- Clone the repository:
git clone https://github.com/petermazzocco/go-x-feeder-bot.git
cd go-x-feeder-bot
- Install dependencies:
go mod download
go run main.go
If you have Air installed:
air
Build and run using Docker:
docker build -t yourname/go-x-feeder-bot:latest .
docker run --env-file .env x-feeder-bot
How to deploy with GitHub:
- Push your code to a Git repository
- Connect your repository to Dokploy
- Create a new app and select your repository
- Configure environment variables in Dokploy dashboard
- Deploy the application
How to deploy with Docker:
- Build and push the Docker image:
docker buildx build --platform linux/amd64 --push -t yourname/go-x-feeder-bot:latest .
- On Dokploy, trigger a build on your service
To get the required Twitter/X tokens:
- Log in to Twitter in your web browser
- Open Developer Tools (F12)
- Go to the Application tab > Storage > Cookies
- Find the
auth_token
cookie for the twitter.com domain - Find the
ct0
cookie, which is your CSRF token
Contributions are welcome! Please feel free to submit a Pull Request.
Testing is currently a work in progress. Right now, you can test a post creation but it will actually send a post to Bluesky as there's no way to mock the Bluesky API in a test environment.
This project is open source and available under the MIT License.