twoot/README.md

55 lines
2.1 KiB
Markdown
Raw Normal View History

2019-08-01 14:03:24 +00:00
I started twoot when [tootbot](https://github.com/cquest/tootbot)
stopped working. Tootbot relies on rss feeds from https://twitrss.me
that broke when Twitter refreshed their web UI in July 2019.
Instead twoot is self contained and handles all the processing.
# Features
* Fetch timeline of given users from twitter.com
* Scrape html and formats tweets for post on mastodon
* Emojis supported
* Upload images from tweet to Mastodon (videos not supported)
* Specify maximum age of tweet to be considered
* Specify minimum delay before considering a tweet for upload
* Remember tweets already tooted to prevent double posting
# usage
```
twoot.py [-h] -t <twitter account> -i <mastodon instance> -m <mastodon
account> -p <mastodon password> [-a <max age in days>]
[-d <min delay in mins>]
```
# arguments
2019-08-01 14:18:15 +00:00
Assuming that the Twitter handle is @SuperDuperBot and the Mastodon account
is @superduperbot@botsin.space
2019-08-01 14:03:24 +00:00
2019-08-01 14:13:41 +00:00
|Switch |Description | Example | Req |
|-------|--------------------------------------------------|--------------------|-----|
2019-08-01 14:16:37 +00:00
| -t | twitter account name without '@' | `SuperDuperBot` | Yes |
2019-08-01 14:13:41 +00:00
| -i | Mastodon instance domain name | `botsin.space` | Yes |
2019-08-01 14:16:37 +00:00
| -m | Mastodon username | `superduperbot` | Yes |
2019-08-01 14:13:41 +00:00
| -p | Mastodon password | `my_Sup3r-S4f3*pw` | Yes |
| -a | Max. age of tweet to post (in days) | `1` | No |
| -d | Min. delay before posting new tweet (in minutes) | `15` | No |
2019-08-01 14:03:24 +00:00
Default max age is 1 day. Decimal values are OK.
2019-08-01 14:13:41 +00:00
Default min delay is 0 minutes.
# installation
Create a folder and copy twoot.py in it.
Add command line to crontab.
For example, to run every 15 minutes starting at minute 1 of every hour
and process the tweets posted in the last 5 days but at least 15 minutes
ago:
```
2019-08-01 14:16:37 +00:00
1-59/15 * * * * /path/to/twoot.py -t SuperDuperBot -i botsin.space -m superduperbot -p my_Sup3r-S4f3*pw -a 5 -d 15
2019-08-01 14:13:41 +00:00
```