Skip to content

Latest commit

 

History

History
94 lines (72 loc) · 3.37 KB

README.md

File metadata and controls

94 lines (72 loc) · 3.37 KB

touitomamout

🦤 → 🦣+☁️

An easy way to synchronize your Twitter's tweets to Mastodon & Bluesky posts.

touitomamout banner

Installation

Pull the project

git pull [email protected]:louisgrasset/touitomamout.git

Install dependencies & build the project

npm ci && npm run build 

Configuration

Touitomamout relies on two APIs:

Mastodon configuration

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.

  1. Go to your account's application page: https://{yourinstance.tld}/settings/applications/new
  2. Create a new application with the following scopes:
  • read:accounts: get your mastodon account username
  • write:media: post medias
  • write:statuses: post toots
  • write:accounts: update your profile
  1. Populate the Environment section with your access token.

Twitter configuration

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:

  1. 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.
  2. Because this project is running with a non-official API, you may not want put your account at risk.

Environment

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:

  1. manual: a simple node script execution
  2. pm2: spanws as a new PM2 process, named with touitomamout-${instance_id} pattern.

Multiple instances

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.

Run it

Manually

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.

Cron

Because automation is cool, feel free to run that script everytime you need to. Simply create your cron here.

PM2 support

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.

PM2: First run

npm run deploy

PM2: Update your instance after a code update

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

Docker

You can alternatively rely on docker and use the docker-compose.yml file.