
🐛: … was apposed to every link regardless of their length See merge request veretcle/oolatoocs!18
oolatoocs, a Mastodon to Twitter bot
So what is it? Originally, I wrote, with some help, Scootaloo which was a Twitter to Mastodon Bot to help the writers at NintendojoFR not to worry about Mastodon: the vast majority of writers were posting to Twitter, the bot scooped everything and arranged it properly for Mastodon and everything was fine and dandy. It was also used, in an altered beefed-up version, for Nupes.social to make the tweets from the NUPES political alliance on Twitter, more easily accessible in Mastodon.
But then Elon came, and we couldn’t read data from Twitter anymore. So we had to rely on copy/pasting things from one to another, which is not fun nor efficient.
Hence oolatoocs
, which takes a Mastodon Timeline and reposts it to Twitter as properly as possible. And since Bluesky seems to be hype right now, it also incorporates Bluesky support since v3.0.0.
Bluesky support is mandatory for now on: you can’t have Twitter or Bluesky, you must have both. I might change this behaviour in a near future, especially when I will inevitably have to drop support for Twitter. If you just want Twitter support, just stick with v2.4.x release, it’ll get the job done exactly as the newer version for now.
If you don’t want Twitter support, open an issue and I will get motivated to comply (maybe…).
Remarkable features
What it can do:
- Reproduces the Toot content into the Tweet/Record;
- Cuts (poorly) the Toot in half in it’s too long for Twitter/Bluesky and thread it (this is cut using a word count, not the best method, but it gets the job done);
- Reuploads images/gifs/videos from Mastodon to Twitter/Bluesky
- Can reproduce threads from Mastodon to Twitter/Bluesky
- Can reproduce poll from Mastodon to Twitter/Bluesky
- Can prevent a Toot from being tweeted/recorded to Bluesky by using the #NoTweet (case-insensitive) hashtag in Mastodon
Configuration file
The configuration is relatively easy to follow:
[oolatoocs]
db_path = "/var/lib/oolatoocs/db.sqlite3" # the path to the DB where toot/tweet are stored
[mastodon] # This part can be generated, see below
base = "https://m.nintendojo.fr"
client_id = "<REDACTED>"
client_secret = "<REDACTED>"
redirect = "urn:ietf:wg:oauth:2.0:oob"
token = "<REDACTED>"
[twitter] # you’ll have to get this part from Twitter, this can be done via https://developer.twitter.com/en
consumer_key = "<REDACTED>"
consumer_secret = "<REDACTED>"
oauth_token = "<REDACTED>"
oauth_token_secret = "<REDACTED>"
[bluesky]
handle = "nintendojofr.bsky.social"
password = "<REDACTED>"
How to generate the Mastodon keys?
Just run:
oolatoocs register --host https://<your-instance>
And follow the instructions.
How to generate the Twitter part?
You’ll need to generate a key. This is a real pain in the ass, but you can use this script, modify it and run it to recover you key.
Will I some day make a subcommand to generate it? Maybe…
How to generate the Bluesky part?
You’ll need your handle and password. I strongly recommend a dedicated application password.
How to run
First of all, the --help
:
A Mastodon to Twitter Bot
Usage: oolatoocs [OPTIONS] [COMMAND]
Commands:
init Command to init the DB
register Command to register to Mastodon Instance
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <CONFIG_FILE> TOML config file for oolatoocs [default: /usr/local/etc/oolatoocs.toml]
-h, --help Print help
-V, --version Print version
Ideally, you’ll put it an cron (from a non-root user), with the default path for config file and let it do its job. Yeah, that’s it.