Getting ready for release

This commit is contained in:
jeancf 2022-11-30 16:33:15 +01:00
parent 0065363d0e
commit 4cbcdcbd84
2 changed files with 54 additions and 24 deletions

View File

@ -1,8 +1,14 @@
**XX NOV 2022** VERSION 2.4 Added command-line option (`-u`) to **23 NOV 2022** VERSION 2.5 Added command-line option (-l) to remove
redirection from links included in tweets. Obfuscated links are replaced
by the URL that the resource is directly downloaded from. Also improved
tracker removal by cleaning URL fragments as well (contrib: mathdatech,
thanks!).
**22 NOV 2022** VERSION 2.4 Added command-line option (-u) to
remove tracking parameters from URLs included in tweets. A tracking URL remove tracking parameters from URLs included in tweets. A tracking URL
is a normal URL with parameters attached to it. These parameters are used is a normal URL with parameters attached to it. These parameters are used
by marketing companies to identify the source of a click and the effectiveness by marketing companies to identify the source of a click and the effectiveness
of a communication campaign. of a communication campaign (contrib: mathdatech, thanks!).
**15 NOV 2022** VERSION 2.3 Added command-line option (`-s`) to **15 NOV 2022** VERSION 2.3 Added command-line option (`-s`) to
skip retweets. With this option, retweets will be ignored and not posted skip retweets. With this option, retweets will be ignored and not posted

View File

@ -3,7 +3,14 @@
Twoot is a python script that mirrors tweets from a twitter account to a Mastodon account. Twoot is a python script that mirrors tweets from a twitter account to a Mastodon account.
It is simple to set-up on a local machine, configurable and feature-rich. It is simple to set-up on a local machine, configurable and feature-rich.
**UPDATE XX DEC 2022** VERSION 3.0 config file / tomli dependency **UPDATE XX DEC 2022** VERSION 3.0 brings some important changes and new features:
* **If you are using a version of python < 3.11 you need to install the `tomli` module**
* Twoot can be configured with a config file in [TOML](https://toml.io/) format. Check `default.toml` for details
* Domain susbtitution can be configured in the config file to replace links to Twitter, Youtube and
Reddit domains with alternatives (e.g. [Nitter](https://github.com/zedeus/nitter/wiki/Instances),
[Invidious](https://redirect.invidious.io/) and [teddit](https://teddit.net/) respectively)
* A password must be provided with `-p` for the first run only. After that it is no longer required.
> Previous updates can be found in CHANGELOG. > Previous updates can be found in CHANGELOG.
@ -23,45 +30,61 @@ It is simple to set-up on a local machine, configurable and feature-rich.
## Usage ## Usage
``` twoot.py [-h] [-f <.toml config file>] [-t <twitter account>] [-i <mastodon instance>]
twoot.py [-h] -t <twitter account> -i <mastodon instance> -m <mastodon account> [-m <mastodon account>] [-p <mastodon password>] [-r] [-s] [-l] [-u] [-v]
-p <mastodon password> [-r] [-s] [-u] [-v] [-a <max age in days)>] [-a <max age in days)>] [-d <min delay (in mins>] [-c <max # of toots to post>]
[-d <min delay (in mins)>] [-c <max # of toots to post>]
```
## Arguments ## Arguments
Assuming that the Twitter handle is @SuperDuperBot and the Mastodon account Assuming that the Twitter handle is @SuperDuperBot and the Mastodon account
is @superduperbot@botsin.space is sd@example.com on instance masto.space:
|Switch |Description | Example | Req | |Switch |Description | Example | Required |
|-------|--------------------------------------------------|--------------------|-----| |-------|--------------------------------------------------|--------------------|--------------------|
| -t | twitter account name without '@' | `SuperDuper` | Yes | | -f | path of `.toml` file with configuration | `SuperDuper.toml` | No |
| -i | Mastodon instance domain name | `botsin.space` | Yes | | -t | twitter account name without '@' | `SuperDuper` | If no config file |
| -m | Mastodon username | `sd@example.com` | Yes | | -i | Mastodon instance domain name | `masto.space` | If no config file |
| -p | Mastodon password | `my_Sup3r-S4f3*pw` | Yes | | -m | Mastodon username | `sd@example.com` | If no config file |
| -v | upload videos to Mastodon | *N/A* | No | | -p | Mastodon password | `my_Sup3r-S4f3*pw` | Once at first run |
| -r | Post reply-to tweets (ignored by default) | *N/A* | No | | -v | upload videos to Mastodon | *N/A* | No |
| -s | Skip retweets (posted by default) | *N/A* | No | | -r | Post reply-to tweets (ignored by default) | *N/A* | No |
| -l | Remove link redirections | *N/A* | No | | -s | Skip retweets (posted by default) | *N/A* | No |
| -u | Remove trackers from URLs | *N/A* | No | | -l | Remove link redirections | *N/A* | No |
| -a | Max. age of tweet to post (in days) | `5` | No | | -u | Remove trackers from URLs | *N/A* | No |
| -d | Min. age before posting new tweet (in minutes) | `15` | No | | -a | Max. age of tweet to post (in days) | `5` | No |
| -c | Max number of toots allowed to post (cap) | `1` | No | | -d | Min. age before posting new tweet (in minutes) | `15` | No |
| -c | Max number of toots allowed to post (cap) | `1` | No |
## Notes ## Notes
### Password
A password must be provided for the first run only. Once twoot has connected successfully to the
Mastodon host, an access token is saved in a `.secret` file named after the mastodon account,
and a password is no longer necessary (command-line switch `-p` is not longer required).
### Config file
A `default.toml` file is provided to be used as template. If `-f` is used to specify a config file
to use, all the other command-line parameters are ignored, except `-p` (password) if provided.
### Removing redirected links
`-l` will follow every link included in the tweet and replace them with the url that the `-l` will follow every link included in the tweet and replace them with the url that the
resource is directly dowmnloaded from (if applicable). e.g. bit.ly/xxyyyzz -> example.com resource is directly dowmnloaded from (if applicable). e.g. bit.ly/xxyyyzz -> example.com
Every link visit can take up to 5 sec (timeout) therefore this option will slow down Every link visit can take up to 5 sec (timeout) therefore this option will slow down
tweet processing. tweet processing.
### Uploading videos
When using the `-v` switch consider: When using the `-v` switch consider:
* whether the copyright of the content that you want to cross-post allows it * whether the copyright of the content that you want to cross-post allows it
* the storage / transfer limitations of the Mastodon instance that you are posting to * the storage / transfer limitations of the Mastodon instance that you are posting to
* the upstream bandwidth that you may consume on your internet connection * the upstream bandwidth that you may consume on your internet connection
### Rate control
Default max age is 1 day. Decimal values are OK. Default max age is 1 day. Decimal values are OK.
Default min delay is 0 minutes. Default min delay is 0 minutes.
@ -73,7 +96,8 @@ No limitation is applied to the number of toots uploaded if `-c` is not specifie
Make sure python3 is installed. Make sure python3 is installed.
Twoot depends on `beautifulsoup4` and `Mastodon.py` python modules. Twoot depends on `beautifulsoup4` and `Mastodon.py` python modules. Additionally, if you are using
a version of python < 3.11 you also need to install the `tomli` module.
**Only If you plan to download videos** with the `-v` switch, are the additional dependencies required: **Only If you plan to download videos** with the `-v` switch, are the additional dependencies required: