Reputation: 25631
rsstail
can't handle OPML list, but can only track single RSS feed, AFAIK
Is there any CLI alternative (tail
like) that can do this task?
Or online service that can transform OPML to valid single URL RSS, which I can then pipe to rsstail?
Upvotes: 2
Views: 584
Reputation: 185530
Here a clean solution, the
OPML
file can have multiple feeds.
From the spec of OPML
linked above:
Subscription lists
A subscription list is a possibly multiple-level list of subscriptions to feeds. Each sub-element of the body of the OPML document is a node of type rss or an outline element that contains nodes of type rss.
xidel -e '//outline[@xmlUrl and @type="rss"]/join(("-u", @xmlUrl))' -s file.opml |
xargs rsstail
The file can be remote, using http
or https
:
xidel --input-format xml \
-e '//outline[@xmlUrl and @type="rss"]/join(("-u", @xmlUrl))' \
-s http://hosting.opml.org/dave/spec/subscriptionList.opml |
xargs rsstail
xidel -e '(//outline[@xmlUrl and @type="rss"]/join(("-u", @xmlUrl)))[1]' \
-s file.opml | xargs rsstail
{
echo ' -u https://stackoverflow.com/feeds '
xidel ..... file.opml
} | xargs rsstail
xidel
: https://github.com/benibela/xidel
xidel
download: https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/
If you are using windows, to prevent quotes issues, run this code as powershell.
Upvotes: 2
Reputation: 25631
cat opml.xml | grep xmlUrl | sed 's/.*xmlUrl="/-u /;s/".*//' | xargs rsstail
Upvotes: 0