Alessandro Dotti Contra

Linux/Unix DevOps


MyRss

What is it?

MyRSS is a dead simple RSS feeds aggregator. It has a lot of limitations, but since it was just a ten minutes python coding exercise and I think it works quite well, I decided to share it.

Get the latest version.

Why?

Because I wanted a really stupid RSS aggregator... something that just downloads the news title and let me decide what to read, without keeping old unread news around. I also wanted to get rid of all the cruft a web page is usually filled with these days. So it needed to be terminal friendly (w3m does all the magic to be honest).

And, most of all, I liked to write some code down :)

How does it work?

First, create a file with the feeds you want to download, one per line, with the first field being a descriptive label, and the second field is the actual url (comments are not allowed, "|" used as a field separator):

Slashdot news|http://rss.slashdot.org/Slashdot/slashdot

then edit `myrss.py` and specify your feeds file:

### FEEDS TO READ
data = "/home/adotti/News/feeds"
###

Last, fire the script:

$> /home/adotti/bin/myrss.py > \
	/home/adotti/News/news.html

and you'll have some fresh news to read.

For my own convenience, I set up a dedicated cron job:

0 * * * * /home/adotti/bin/myrss.py > \
	/home/adotti/News/news.html

Warnings

There's of course a huge room for improvements... here are some things that should be added:

  • handle UTF8 encondigs (odd characters are simply ignored now)
  • add checks and sanitation to news titles
  • handle relevant exceptions