Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/bclindner/mastodril
- Owner: bclindner
- Created: 2018-11-22T05:38:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-23T13:53:34.000Z (almost 5 years ago)
- Last Synced: 2024-10-07T07:41:30.213Z (3 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.