Skip to content

A lightweight program to crosspost from Mastodon to Twitter, suitable for self-hosting.

License

Notifications You must be signed in to change notification settings

mcartmell/mastodon-twitter-crosspost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastodon-Twitter-Crosspost

A lightweight program to crosspost from Mastodon to Twitter, suitable for self-hosting. It will poll the Mastodon instance every minute for new posts and post them to Twitter.

WARNING This is a work in progress with only basic functionality for cross-posting tweets and your own replies.

Getting Started

Prerequisites

Twitter API v1.1 is required for posting media, and v2.0 is required for posting tweets.

Installing

go install github.com/mcartmell/mastodon-twitter-crosspost@latest

Create a .env file with your credentials, for example:

MASTODON_URL=https://mastodon.example.com
MASTODON_ACCOUNT_ID=123456789
TWITTER_OAUTH2_REDIRECT_URI=http://localhost:8888
TWITTER_OAUTH2_CLIENT_ID=123456789
TWITTER_OAUTH2_CLIENT_SECRET=123456789
TWITTER_CONSUMER_KEY="123456789"
TWITTER_CONSUMER_SECRET="123456789"
TWITTER_ACCESS_TOKEN="123456789"
TWITTER_ACCESS_TOKEN_SECRET="123456789"
LISTEN_PORT=8888

Run the program:

mastodon-twitter-crosspost

The program will output a link to authorize API access to your Twitter account. Follow the instructions to complete the authorization.

Features

  • Crossposts from Mastodon to Twitter
  • Supports crossposting own threads
  • Supports images

TODO

This is a work in progress with many missing features:

  • Support for videos
  • Support for content warnings

Deployment

There is a Dockerfile included for deployment, intended for self-hosting with minimal memory usage.

License

This project is licensed under the MIT license, see the LICENSE file for details.

About

A lightweight program to crosspost from Mastodon to Twitter, suitable for self-hosting.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published