A simple tool which lets you scrape twitter accounts and crosspost them to bluesky accounts! Comes with a CLI and a webapp for managing profiles! Works with images/videos/link embeds/threads.
TypeScript 61.1%
HTML 30.7%
JavaScript 7.4%
Shell 0.7%
66 2 0

Clone this repository

https://tangled.org/indexx.dev/tweets2bsky https://tangled.org/did:plc:sfjxpxxyvewb2zlxwoz2vduw/tweets2bsky
git@tangled.org:indexx.dev/tweets2bsky git@tangled.org:did:plc:sfjxpxxyvewb2zlxwoz2vduw/tweets2bsky

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Tweets-2-Bsky#

A powerful tool to crosspost Tweets to Bluesky, supporting threads, videos, and high-quality images.

Features#

  • 🔄 Crossposting: Automatically mirrors your Tweets to Bluesky.
  • 🧵 Thread Support: INTELLIGENTLY handles threads, posting them as Bluesky threads.
  • 📹 Video & GIF Support: Downloads and uploads videos/GIFs natively to Bluesky (not just links!).
  • 🖼️ High-Quality Images: Fetches the highest resolution images available.
  • 🔗 Smart Link Expansion: Resolves t.co links to their original URLs.
  • 👥 Multiple Source Accounts: Map multiple Twitter accounts to a single Bluesky profile.
  • ⚙️ Web Dashboard: Manage accounts, view status, and trigger runs via a modern UI.
  • 🛠️ CLI & Web Support: Use the command line or the web interface.

Quick Start#

  1. Clone the repository:

    git clone https://github.com/yourusername/tweets-2-bsky.git
    cd tweets-2-bsky
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    
  4. Start the server:

    npm start
    

    Access the dashboard at http://localhost:3000.

Updating#

To update to the latest version without losing your configuration:

./update.sh

This script will pull the latest code, install dependencies, and rebuild the project. Restart your application after running the update.

Configuration & Security#

Environment Variables#

Create a .env file for security (optional but recommended):

PORT=3000
JWT_SECRET=your-super-secret-key-change-this

⚠️ Security Note: If you do not set JWT_SECRET, a fallback secret is used. For production or public-facing deployments, YOU MUST SET A STRONG SECRET.

Data Storage#

  • config.json: Stores your account mappings and encrypted web user passwords. Note that Bluesky app passwords are stored in plain text here to facilitate automated login. Do not share this file.
  • data/database.sqlite: Stores the history of processed tweets to prevent duplicates.

Usage#

Web Interface#

  1. Register your first account (this user becomes the Admin).
  2. Go to settings to configure your Twitter Auth Token and CT0 (cookies).
  3. Add mappings:
    • Enter one or more Twitter Usernames (comma-separated).
    • Enter your Bluesky Handle and App Password.
  4. The system will check for new tweets every 5 minutes (configurable).

CLI#

  • Add Mapping: npm run cli add-mapping
  • Edit Mapping: npm run cli edit-mapping
  • Import History: npm run cli import-history
  • List Accounts: npm run cli list

🤖 Gemini AI Alt Text (Optional)#

This tool can automatically generate Alt Text for images using Google's Gemini AI if the original tweet lacks it.

  1. Get an API Key: Get a free API Key from Google AI Studio.
  2. Configure:
    • Web UI: Go to the Admin Dashboard and paste your key in the "Gemini AI (Alt Text)" section.
    • Disable: Leave the field empty to disable this feature (default).

Twitter Cookies (Auth)#

You need your Twitter auth_token and ct0 cookies.

  1. Log in to Twitter/X in your browser.
  2. Open Developer Tools (F12) -> Application -> Cookies.
  3. Copy the values for auth_token and ct0.

License#

MIT