1
0
Fork
You've already forked tootbot-py
0
python bot to clone tweets to a mastodon account
  • Python 93.6%
  • Shell 6.4%
Find a file
2021年12月29日 15:20:10 +00:00
.gitignore gitignore to preserve secrets 2017年05月28日 15:04:23 +02:00
cron-sample.sh Update cron-sample.sh 2020年08月15日 18:15:53 +02:00
LICENSE Initial commit 2017年05月28日 09:34:54 +02:00
README.md Update to git.qoto.org 2021年03月10日 13:02:27 +00:00
requirements.txt missing endline 2019年04月03日 17:48:48 +02:00
tootbot.py Update tootbot.py 2021年12月29日 15:20:10 +00:00
tootbot@my_bot@my_instance.conf Added token authentication method 2020年08月17日 14:50:10 +02:00

TootBot

A small python 3.x script to replicate tweets on a mastodon account.

Forked from https://github.com/cquest/tootbot Specialized in RSS feed, in particular from Nitter (https://nitter.net - https://github.com/zedeus/nitter)

It gets the tweets from RSS available at https://nitter.net, then does some cleanup on the content:

  • twitter tracking links (t.co) are dereferenced
  • twitter hosted pictures are retrieved and uploaded to mastodon
  • the tweets from RSS source's are joined based on the domain name to avoid duplicates

It can also toot RSS/atom feeds (see cron-example.sh).

A sqlite database is used to keep track of tweets than have been tooted.

The script is simply called by a cron job and can run on any server.

Setup

# clone this repo
git clone https://git.qoto.org/m33/tootbot-py.git
cd tootbot
# install required python modules
pip3 install -r requirements.txt

Configuration file

The configuration file should be placed in a safe directory (not world or group readable), and contains the instance and authentication credentials. You must complete the config file and provide authentication credentials to your desired mastodon account. A sample config file 'tootbot@my_bot@my_instance.conf' is provided as a starting point.

Authentication methods

This app support both email and application token authentication. You are strongly encouraged to create an application with dedicated app id, secret and access token for this bot. See the "Development" and "New application" pannel in your mastodon account settings.

Useage

With a plain RSS/atom feed:

python3 tootbot.py [full path to authentication config file] https://your-rssfeed-source.com/recent.atom 2 your_hashtag 0

(all arguments are mandatory)