Tweet a RSS feed only if it matches a specific pattern with Feed2tweet

You know a really interesting blog with a RSS feed and you want to tweet about theses articles, but only if you can find a specific pattern in the title, like “cryptocurrencies”, “MySQL” or anything ? That’s a job for your Twitter bot Feed2tweet !

Feed2tweet, un projet peu coûteux en temps de travail grâce aux facilités offertes par le Logiciel Libre

Configuration for pattern matching of one RSS feed

To configure Feed2tweet to apply pattern matching for one RSS feed, you need to define the pattern matching in your Feed2tweet configuration:

[rss]

uri: https://carlchenet.com

...

title_pattern: Open Source

title_pattern_case_sensitive: false

The above configuration defines that only the RSS entries with the text of the title section matching “open source” (not case sensitive here) of the RSS feed will be tweeted. For a full example, have a look at the Configure section of the official Feed2tweet documentation.

Configuration for pattern matching of multiple RSS feeds

The configuration of Feed2tweet is slightly different for mulitple RSS feeds. Just change the uri parameter to uri_list:

[rss]

uri_list: /etc/feed2tweet/rsslist.txt

...

title_pattern: MySQL

title_pattern_case_sensitive: true

The rsslist.txt file should have an url by line:

https://carlchenet.com/feed

https://www.linuxjobs.io/rss

Here only the RSS entries with the text of the title section matching “MySQL” (case sensitive here) of all RSS feeds will be tweeted.

Ok, but what if we would like define by-RSS-feeds pattern matching, in order to know exactly what we are looking for in each RSS feed?

By-RSS-feed pattern matching

So now we need global filters “released” and “is available” for all of our feeds, but “feed2tweet” specifically for Carl Chenet’s Blog and  “debian” for Raphael Hertzog’s Blog. Here are the Feed2tweet configuration:

[rss]

uri_list: /etc/feed2tweet/rsslist.txt

...

title_pattern: released,is available,
 

title_pattern_case_sensitive: false

The rsslist.txt file should have an url by line:

https://carlchenet.com/feed|title|feed2tweet

http://feeds.feedburner.com/RaphaelHertzogCom|title|debian

Powerful pattern matching to choose what to send to Twitter

As you could read above, Feed2tweet offers several possibilities for the pattern matching in the RSS feeds. You’ll be able to tweet only entries your Twitter followers will be interested in, and not the whole entries of a RSS feed.

More information about Feed2tweet

… and finally

You can help the Feed2tweet Bot by donating anything through Liberaypay (also possible with cryptocurrencies). That’s a big factor motivation 😉

One thought on “Tweet a RSS feed only if it matches a specific pattern with Feed2tweet

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *