An easy way to synchronize your Twitter's tweets to Mastodon & Bluesky posts.
Pull the project
git pull [email protected]:louisgrasset/touitomamout.git
Install dependencies & build the project
npm ci && npm run build
Touitomamout relies on two APIs:
In order to communicate with the mastodon instance, you'll have to generate an API Token. It's totally free. Reminder: your application name will be publicly visible.
- Go to your account's application page:
https://{yourinstance.tld}/settings/applications/new
- Create a new application with the following scopes:
read:accounts
: get your mastodon account usernamewrite:media
: post mediaswrite:statuses
: post tootswrite:accounts
: update your profile
- Populate the Environment section with your
access token
.
The tweets retrieval by itself can be done without Twitter credentials. But keep in mind that twitter currently blocks guests to access users' replies. Touitomamout is trying to restore the previous session so you'll not get spammed by the Twitter security team for each connection.
Note
The configuration allows you to sync a first account and authenticate with a secondary account for two reasons:
- Currently, there is no simple way to authenticate with an account having 2FA enabled, so you may not want to lower your main account security.
- Because this project is running with a non-official API, you may not want put your account at risk.
First things first, please copy the .env.example
file to .env
.
Then, please fill each variable.
Warning
Do not forget to properly choose the
EXECUTION
variable. Two values are allowed:
manual
: a simple node script executionpm2
: spanws as a new PM2 process, named withtouitomamout-${instance_id}
pattern.
This project supports a multiple instances mode. To do so, simply provide multiple .env
files such as .env.instance1
and .env.instance2
.
deploy
& deploy:update
scripts will handle them properly.
You can simply run a node ./dist/index.js .env
and have a one shot sync of your recent tweets.
Note
Don't forget to replace
.env
with the right .env filename.
Because automation is cool, feel free to run that script everytime you need to. Simply create your cron here.
PM2 is a utility that allows you to monitor and run periodically your node scripts. Thus, it can be useful for some users to deploy Touitomamout to a PM2 instance.
npm run deploy
Your instance will be removed and will be generated again with the latest codebase.
Your cache.instance.json
file is kept, so you won't have duplicated toots.
npm ci &&
npm run build &&
npm run deploy:update
You can alternatively rely on docker and use the docker-compose.yml
file.