You’re a proud new user of the Mastodon social network and you want to share the great articles of your cool blog thanks to a RSS feed. Awesome, use the Feed2toot bot for that!
A really cool feature of Feed2toot is you can toot (just in case toot means sending messages to Mastodon) any section of your RSS feed, e.g the title of your blog post, but also the summary, the commentsn the author and so on. It totallly depends on your RSS feeds.
What sections are available in your RSS feeds?
Ok, Whare are the available RSS sections of our RSS feeds? Lets consider the following configuration file for this very blog. The file is carlchenet.com.ini
[mastodon] instance_url=https://mastodon.social user_credentials=feed2toot_usercred.txt client_credentials=feed2toot_clientcred.txt [cache] cachefile=carlchenet.com.db [rss] uri=https://carlchenet.com/feed tweet={title} {link} [hashtaglist] several_words_hashtags_list=hashtags.txt
The important parameters here are in the [rss] section. We just define the url of the RSS feed. We also define a tweet parameter that we’ll explain later.
Here is the command to get all the available RSS sections of your current RSS feed (the one defined by the uri parameter):
$ feed2toot --rss-sections -c carlchenet.com.ini The following sections are available in this RSS feed: ['links', 'title', 'author_detail', 'summary_detail', 'authors', 'tags', 'id', 'wfw_commentrss', 'published', 'published_parsed', 'summary', 'comments', 'title_detail', 'author', 'link', 'content', 'slash_comments', 'guidislink']
Whoa, lots of RSS sections here. The choice is great.
A new toot template matching your own needs
Ok, we now define a new toot template, in order to provide cool content to Mastodon. Let’s use the tweet parameter of the RSS section see above:
tweet={author} just wrote a new blog post: {title} \n {link}
With this template, {author} will be replaced by the author of the blog post, {title} by the title of the blog post and {link} obviously by the link to the article.
As we just described, Feed2toot is a powerful tool to export the data of your RSS feed to the Mastodon social network. This is still a young project, don’t hesitate to open bug reports if you encounter unexpected behaviours.
More information about Feed2toot
- Feed2toot on Gitlab.com (would be awesome starring it if you like/use it)
- The official documentation on Readthedocs.io
… and finally
You can help the Feed2toot Bot by donating anything through Liberaypay (also possible with cryptocurrencies). That’s a big factor motivation 😉