pyfeed: a new and very simple CLI RSS feed reader

Posted 8 May 2023 (2023-05-08)

pyfeed is a command-line modal RSS feed reader I have been building over the last few days. I made it because I was frustrated with newsboat and how its keybind system works. I needed something simpler thus pyfeed was born.

First, you make a text file called urls, then you populate it with a list of some RSS feeds such as the feed for this blog (shameless, I know), you run pyfeed and an interface comes up.

parsing https://soda.privatevoid.net/num/blog/index.xml
parsing http://feeds.rssboard.org/rssboard
    Articles  Feed Title
 0  8         num's soda page
 1  15        RSS Advisory Board
[pyfeed view: feeds ]

Now the way this works is you get a list of items then a bunch of commands to operate on those items. One of the commands we can use is open. It takes in one of those indexes on the left so it knows what feed you want to open.

parsing https://soda.privatevoid.net/num/blog/index.xml
parsing http://feeds.rssboard.org/rssboard
    Articles  Feed Title
 0  8         num's soda page
 1  15        RSS Advisory Board
[pyfeed view: feeds ] open 0
Articles for num's soda page
    Published on  Article Title
 0  28 Feb 2023   The 3 Golden Rules
 1  21 Feb 2023   Back out of Maintenance Mode with HUGE Improvements!
 2  10 Feb 2023   Maintenance Mode
 3  03 Jan 2023   You can't always go it alone.
 4  26 Sep 2022   Distractions Are Destroying Our Lives
 5  31 May 2022   File System Consistency: what Linux fails hard at that others don't.
 6  05 Sep 2020   Attack of the Clones
 7  29 Jul 2020   Using rsync to make uploading my site easier
[pyfeed view: articles ]

Running open 0 we get a list of the articles in the chosen feed. Notice too in the prompt section the “view” has changed. This is where the modal element comes in. There are many views, in the code known as contexts, that basically mean we can have 1 command, such as open, which can function differently depending on the context we’re in.

The view/context (same thing, really) we’re in right now is the articles view. This means that if we run open 0 again we’ll open up the article at the index 0 in the list.

If we decide we don’t want to look at these blog posts and want to look at another feed – I mean why you’d want to do that I don’t know considering how epic they are – we can run another command called back which simply takes us back to the feeds view.

parsing https://soda.privatevoid.net/num/blog/index.xml
parsing http://feeds.rssboard.org/rssboard
    Articles  Feed Title
 0  8         num's soda page
 1  15        RSS Advisory Board
[pyfeed view: feeds ] open 0
Articles for num's soda page
    Published on  Article Title
 0  28 Feb 2023   The 3 Golden Rules
 1  21 Feb 2023   Back out of Maintenance Mode with HUGE Improvements!
 2  10 Feb 2023   Maintenance Mode
 3  03 Jan 2023   You can't always go it alone.
 4  26 Sep 2022   Distractions Are Destroying Our Lives
 5  31 May 2022   File System Consistency: what Linux fails hard at that others don't.
 6  05 Sep 2020   Attack of the Clones
 7  29 Jul 2020   Using rsync to make uploading my site easier
[pyfeed view: articles ] back
    Articles  Feed Title
 0  8         num's soda page
 1  15        RSS Advisory Board
[pyfeed view: feeds ]

Now we’re back at the feeds view.

I haven’t went over actually reading the articles because that’s where it falls short as of writing. I wanted to at least give an overview of the cool idea behind how this works but so far this is about as much as it can do. I’ve been working on it for a few days now and am only starting to figure out how to parse HTML for outputting to the terminal so suggestions and maybe even PR’s would be appreciated. I think it has potential to be useful.