Script to convert OPML file to GNU recutils database
The Newsboat RSS reader is an awesome RSS reader.
It runs in your terminal, so can be used inside a Tmux session.
Newsboat uses a plain text file for the user to configure his or her list with RSS feeds.
The GNU Recutils is a set of tools and libraries to access human-editable, plain text databases called recfiles.
These recfiles can be generated by scripts and are not only human-editable but also machine-readable.
OPML (Outline Processor Markup Language) is an XML format for outlines which is used to import and export RSS feed lists between different RSS readers.
Newsboat can export its list of feeds in the OPML
Simple script to create GNU recutils recfile
#!/bin/sh echo "%rec: newsfeeds" > feeds.rec echo "%mandatory: feed url title" >> feeds.rec echo "%sort: title" >> feeds.rec echo "%unique: url" >> feeds.rec newsboat -e | grep outline | sed 's/ <outline type="rss" /\ /' | sed "s/xmlUrl=/feed: /" | sed 's/htmlUrl=/\ url: /' | sed 's/title=/\ title: /' | sed 's/\/>//' | sed 's/\"//g' >> feeds.rec echo "Feeds written to feeds.rec"
This script reads the output from
newsboat -e and parses that
with sed to create the recfile.
Here is an example of the output:
%rec: newsfeeds %mandatory: feed url title %sort: title %unique: url feed: https://susam.in/blog/rss.xml url: https://susam.in/blog/ title: Susam's Blog feed: http://news.dieweltistgarnichtso.net/notes/index.xml url: http://news.dieweltistgarnichtso.net/notes/index.xml title: notes feed: https://daringfireball.net/feeds/main url: https://daringfireball.net/ title: Daring Fireball ....
For me this was a first step. I can now add categories to the records.
This way I can manage my feeds better, and have a sound set of categories :)
Kudos to Sergey Matveev for publishing his feeds and links as a recfile. See his links page