Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bclindner/mastodril

Bot to mirror Twitter posts on a Mastodon account.
https://github.com/bclindner/mastodril

Last synced: about 1 month ago
JSON representation

Bot to mirror Twitter posts on a Mastodon account.

Awesome Lists containing this project

README

        

# mastodril

A hacky Go script that syncs a Twitter user's Tweets to a Mastodon account.
This is primarily used to mirror [@dril](https://twitter.com/dril)'s tweets
to a [Mastodon account](https://botsin.space/@mastodril), hence the name.

## Configuration

A valid config file is stored in `mastodril.json` in the same folder as the
executable, and looks like this. You'll need app credentials for Twitter and
Mastodon.
```json
{
"handle": "",
"twitter": {
"consumerKey": "",
"consumerSecret": "",
"accessToken": "",
"accessSecret": ""
},
"mastodon": {
"server": "",
"clientID": "",
"clientSecret": "",
"accessToken": ""
}
}
```

## Author's Note

The bot does not run as a daemon - it's a oneshot process that syncs the
last 5 tweets, then takes the last tweet in that list and stores its ID
to a file. It then pulls up that file on the next run and tries to find at
most 5 tweets starting from that saved point. It's intended to be run as
a cron/systemd.timer job every 5-30 minutes or so.

As such, if the user you're trying to mirror posts a lot, this may not be
a feasible script to use. Theoretically Twitter's streaming API would work
well there, but that comes with its own set of pitfalls (ratelimiting,
filtering problems, etc). This is a simple enough solution for syncing
slower timelines.