2017-05-29 21:03:17 +00:00
|
|
|
# TootBot
|
|
|
|
|
2025-01-24 14:08:40 +00:00
|
|
|
A small python 3.x script to replicate RSS and posts on bluesky to a mastodon account.
|
2017-05-29 21:03:17 +00:00
|
|
|
|
|
|
|
The script only need mastodon login/pass to post toots.
|
|
|
|
|
2025-01-24 14:08:40 +00:00
|
|
|
It gets the BS posts thru their public API.
|
|
|
|
- externally hosted pictures or videos are retrieved with **yt-dlp** and uploaded to mastodon
|
2017-05-29 21:03:17 +00:00
|
|
|
|
2019-04-03 15:56:38 +00:00
|
|
|
It can also toot RSS/atom feeds (see cron-example.sh).
|
|
|
|
|
2017-05-29 21:03:17 +00:00
|
|
|
A sqlite database is used to keep track of tweets than have been tooted.
|
|
|
|
|
2025-01-24 14:08:40 +00:00
|
|
|
Threads are maintained as far as possible, but replies and reposts and not replicated.
|
2017-05-29 21:03:17 +00:00
|
|
|
|
|
|
|
The script is simply called by a cron job and can run on any server (does not have to be on the mastodon instance server).
|
2018-10-19 13:52:02 +00:00
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
2022-12-07 10:46:09 +00:00
|
|
|
```shell
|
2018-10-19 13:52:02 +00:00
|
|
|
# clone this repo
|
|
|
|
git clone https://github.com/cquest/tootbot.git
|
|
|
|
cd tootbot
|
|
|
|
|
|
|
|
# install required python modules
|
|
|
|
pip3 install -r requirements.txt
|
2018-10-19 13:56:53 +00:00
|
|
|
|
2022-11-23 20:01:48 +00:00
|
|
|
# install additional required software
|
2025-01-24 14:08:40 +00:00
|
|
|
sudo apt install jq ffmpeg
|
2022-12-07 10:46:09 +00:00
|
|
|
```
|
2022-11-23 20:01:48 +00:00
|
|
|
|
2018-10-19 13:56:53 +00:00
|
|
|
## Useage
|
|
|
|
|
2022-05-02 14:08:15 +00:00
|
|
|
`python3 tootbot.py <twitter_pseudo> <mastodon_account> <mastodon_password> <mastodon_domain> [max_items [tags_to_add]]`
|
2018-10-19 13:56:53 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
`python3 tootbot.py geonym_fr geonym@mastodon.mydomain.org **password** mastodon.mydomain.org`
|
|
|
|
|
|
|
|
It's up to you to add this in your crontab :)
|
2019-04-03 15:56:38 +00:00
|
|
|
|
|
|
|
With a plain RSS/atom feed:
|
|
|
|
|
|
|
|
`python3 tootbot.py https://www.data.gouv.fr/fr/datasets/recent.atom cquest+opendata@amicale.net **password** amicale.net 2 "#dataset #opendata #datagouvfr"`
|