rsstail
无法处理 OPML 列表,但只能跟踪单个 RSS feed,据我所知
是否有任何 CLI 替代方案(tail
之类)可以完成此任务?
或者可以将 OPML 转换为有效的单个 URL RSS 的在线服务,然后我可以将其通过管道传输到 rsstail?
最佳答案
这里有一个干净的解决方案,OPML
文件可以有多个提要。
来自上面链接的 OPML
规范:
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 :
xidel -e '//outline[@xmlUrl and @type="rss"]/join(("-u", @xmlUrl))' -s file.opml |
xargs rsstail
文件可以是远程的,使用http
或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
下载:https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/
如果您使用 windows ,为了防止引号问题,请将此代码运行为 powershell 。
关于bash - 具有 OPML 支持的 RSSTail 替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9429595/