This is a little script + daemon to provide RSS streams in irssi. Usage is quite simple, as I will explain below...
This repository consists of the following files:
This is the daemon that requests the RSS/XML feeds with some
interval. It will store the data in ~/.irssi/irssi-rss/rssfeeder_<hash>
for irssi-rss.pl
to read, parse and display. This little daemon runs in
the background, and by default checks the feeds every five minutes.
Since rssfeeder keeps track of itself, you can put this in cron like so:
@hourly rssfeeder --cron
and it will automatically restart, if it might die for some reason.
This file contains all the feeds you want to display in irssi. As an example, slashdot is included. The syntax is fairly simple, a unique tag, and a direct URL to the RSS feed on a single line is enough. So if you were to add the Debian Security Advisory RSS feed you'd add the line:
DSA http://www.debian.org/security/dsa.rdf
to this file, and rssfeeder will automatically pick it up after a while.
This is the perl script that you will load in irssi to parse the feeds and maintain a record on what has been announced and what is new news. By default it checks for new items every 10 seconds.
TIP: Look for the 'filterURL' subroutine in this source code. You can manipulate the URL of an item just before it gets announced. You can for example make URLs like:
http://example.tld/news/12345/abc/rss/long-useless-news-item-title-here.html
Appear as:
http://example.tld/news/12345/abc/rss.html
This works for most sites. The numbers and letters in the URL are significant, the rest of the path is not.
This is a symlink, so irssi-rss gets loaded automatically at startup. You may remove this if you don't want irssi-rss to be loaded at irssi startup automatically.
The script binds a new command /rss
in irssi. You can use this to
review the feeds, or publically announce items you find interessting
enough to share with your IRC friends. By default, irssi-rss.pl
will
NOT announce the news items publically, but it can do so if desired.
A short description of the available options inside irssi:
/rss list
Will show all news items
/rss list <feedtag>
Will show all news items for this specific feed-tag.
/rss reset
Will reset the "statehash". This causes all old items to be announced again, but it will also free the memory claimed by the statehash which, in this version, keeps growing and growing ;)
/rss say <tag-item#>
Will publically announce the specific news item to the current window. Please ensure yourself that you are announcing the correct item, since positions will change. Newest items are always at the beginning.
/rss help
Will show a short summary of supported commands.
rssfeeder, the deamon that retrieves the RSS feeds, depends on:
Unix::Syslog
, provided by Debian package libunix-syslog-perlLWP::Simple
, provided by Debian package libwww-perlDigest::MD5
, provided by Debian package perl
irssi-rss.pl, the irssi loadable script, depends on:
Digest::MD5
, provided by Debian package perlURI::Escape
, provided by Debian package liburi-perl- And the modules provided by irssi itself.
By default, news announcements will go to the currently active window. If you do not like this, you can name a window 'irssi-rss' and this will cause all announcements to go to that window instead of the current active window. To select a window for this purpose, go to that specific window, and type:
/window name irssi-rss
The next announcements will go to that window instead of the current active window.
I have personally switched to using a selfhosted installation of https://tt-rss.org/ in a browser window. It combines nice with the tt-rss (Android) app.
With questions, comments, bugs, improvements and such, feel free to contact me: https://github.com/sndrsmnk/