generate a rss feed from Twitter or Mastodon search
Project description
python-twootfeed
generate a rss feed from parsed Twitter or Mastodon search and Mastodon favorites
The RSS feed displays only the original tweets (not the retweets) and toots, with:
- links to :
- the tweet on Twitter or toot on Mastodon
- hashtags
- usernames
- URLs
- images
- source
- location (only for Twitter)
- numbers of retweets and likes for tweets and boosts and favourites for toots
(see examples below).
Requirements
- Python 3.6+
- API keys Twitter and/or Mastodon
Installation and configuration
- Install from pip
$ pip install twootfeed
- Initialize the configuration file
$ twootfeed_init
-
Fill in fields for the client(s) you will use in '~/.config/twootfeed/config.yml' :
- for Twitter : see https://apps.twitter.com
copy/paste the Twitter API key values in config.yml file ('consumerKey' and 'consumerSecret') - for Mastodon : see Python wrapper for the Mastodon API
use the included script which will register your app and prompt you to log in, creating the credential files for you.
$ twootfeed_create_mastodon_cli
Update the feed and app parameters.
- for Twitter : see https://apps.twitter.com
-
The files location can be changed with the following environment variables:
variable | description | app default value |
---|---|---|
TWOOTFEED_CONFIG_DIR |
configuration and credentials files directory | '~/.config/twootfeed/' |
TWOOTFEED_CONFIG_FILE |
config file full path | config dir + 'config.yml' => with default value: '~/.config/twootfeed/config.yml' |
TWOOTFEED_LOG |
application log file | no default value (log printed on the console) |
- Start the app
$ twootfeed
Usage
The RSS feeds are available on these urls:
- for Twitter: http://localhost:8080/ or http://localhost:8080/tweets/
- for Mastodon:
- search:
- keyword as a hashtag: http://localhost:8080/toots/ (without the leading #)
- query: http://localhost:8080/toot_search/
- connected user favourites: http://localhost:8080/toot_favorites
- search:
Examples
Search on Twitter
Results in RSS Feed:
Display on FreshRSS, a great free self-hosted aggregator (https://github.com/FreshRSS/FreshRSS):
Search on Mastodon
Results in RSS Feed:
Display on FreshRSS:
Contribute
see Quick start for developers
Contributors
Thanks to:
- georgedorn for adding:
- rss feed generation with authenticated user's favorites
- script to register the app and generate credentials for Mastodon
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for twootfeed-0.6.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa72cd2a389aeb3821fb55a434d6a8d54f078142d8905c31d05de8e95ff1b7c1 |
|
MD5 | f4da6d8c71baf56732b8ac2db2275278 |
|
BLAKE2b-256 | e141e5ca4faeb548920dc5b65e755746d10c6990924b664ec0400fa065154ab3 |