• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mastodon <-> Twitter cross-poster.

MastodonToTwitter

Mastodon ⬄ Twitter real-time cross-poster, using streaming APIs.

Requirements: Python 3.6 minimum, with two packages, python-twitter version 3.2 upwards and Mastodon.py version 1.0.2 upwards:

# Python 3
pip3 install -r requirements.txt

You can also use a virtual environment, if you don't use a container, but take care to adapt the paths to the Python binary in the SystemD service.

For basic usage, execute from the project directory

python -m mtt

and follow the on-screen prompts.

The script stores your credentials in a bunch of files ending on .secret. The contents of these files let people access your twitter and Mastodon accounts, so do not share them around.

There is also a mtt_status_associations.json file created. It stores which tweet corresponds to which toot, and is used to synchronize threads. You can delete it at any moment, but if you do, old threads will no longer be synced. More importantly, replies to old theads on the Twitter side will not be posted on Mastodon at all.

To customize options, you can either modify directly the mtt/config.py file (best option if you want to tweak a few things and forget this), or create a mtt/user_config.py file and copy the configuration variables you want to change there (best option if you want to be able to update this using git pull and don't want to alter the core files).

Docker

To setup MastodonToTwitter first run the following command and follow instructions:

docker-compose run --rm mtt

Once setup you just need to run the following command in future.

docker-compose up -d

Systemd

The MastodonToTwitter.service.sample file is a systemd service. You can copy it to MastodonToTwitter.service, edit it to change the install path, symlink it to /etc/systemd/system/, and then use systemctl start|stop|restart|status MastodonToTwitter and journalctl -u MastodonToTwitter.service to run this as a simple service.

The MastodonToTwitter.service file is in the gitignore file, so you will not have a problem when updating.

Heroku

You can run this on a free heroku dynamo

Add heroku as a remote repository with heroku git:remote -a your-app-here

Create a runtime.txt file which contains:

python-3.6.1

Create a Procfile which contains

worker: python3 -m mtt

Commit and push your changes to heroku master.

Open a bash shell on heroku with heroku run bash and follow the basic usage instructions to generate your tokens.

Exit bash and scale your heroku instance heroku ps:scale worker=1 to get things going.

More Repositories

1

OranjeProxy

OranjeProxy est un script de proxy PHP anonymisant permettant d’outrepasser les restrictions imposées à votre réseaux (comme ceux des entreprises ou des écoles).
PHP
22
star
2

flarum-ext-syndication

Brings RSS and Atom feeds to Flarum
PHP
20
star
3

URLShortener

µRL Shortener is a lightweight URL shortener (one file only, the database is a simple file) with really simple statistics support.
PHP
10
star
4

temps-de-parole

A simple web application to monitor speaking time at conferences, debates, etc.
Vue
7
star
5

wallabag-baggy-theme

A fork of the wallabag theme “baggy”, with reading comfort in mind. Some ideas taken from Ploum's website (http://ploum.net).
CSS
5
star
6

AdventOfCode2019

My answers to Advent of Code, 2019 edition
Rust
3
star
7

amaury.carrade.eu

Raw content of my website (Grav user folder).
3
star
8

outils.carrade.eu

Petits outils d'Amaury Carrade. Anciennement site principal. [À jour. L'a été. Un jour.]
PHP
3
star
9

my-tea.party

🍵 Tea, tea everywhere
Python
3
star
10

AdventOfCode2020

My solutions for Advent of Code, 2020 Edition, in Scala this year.
Scala
2
star
11

zds-channel-year-progress-bot

Updates the year's progress in a Discord channel
Go
2
star
12

wine-contest-quizz

On-demand quizz website for the EHL Wine Contest Team. Per-category, per-difficulty, and other filters. This project is not technically specific to the Wine Contest Team.
Python
1
star
13

OperaQRCode

An opera add-on which shows a QRCode of the current page in a popup.
JavaScript
1
star
14

Webnel-Admin

The Webnel's administration UI
JavaScript
1
star
15

quantic_sort

Python
1
star
16

AnnaLythic

PHP
1
star
17

grav-theme-amaury-carrade

Gabari Grav du site d’Amaury Carrade (anciennement Nebulius)
Twig
1
star
18

SafePortals

Ensures the nether portals created are always inside the vanilla WorldBorder
Java
1
star
19

InstantUpload

Instant upload to custom server with link in clipboard
Java
1
star