bash - 具有 OPML 支持的 RSSTail 替代方案?

标签 bash rss opml

rsstail 无法处理 OPML 列表,但只能跟踪单个 RSS feed,据我所知

是否有任何 CLI 替代方案(tail 之类)可以完成此任务?

或者可以将 OPML 转换为有效的单个 URL RSS 的在线服务,然后我可以将其通过管道传输到 rsstail?

最佳答案

note 这里有一个干净的解决方案,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 -e '//outline[@xmlUrl and @type="rss"]/join(("-u", @xmlUrl))' -s file.opml |
    xargs rsstail

文件可以是远程的,使用httphttps:

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/


如果您使用 ,为了防止引号问题,请将此代码运行为

关于bash - 具有 OPML 支持的 RSSTail 替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9429595/

相关文章:

linux - 在 shell 脚本中使用 sed 替代不起作用

oracle - sqlplus shell脚本中方括号中的@(at符号)是什么意思?

php - 检查有效的 RSS 提要 URL

python - 手动将 OPML 订阅(文件)导入到 Google Reader

php - 关于用 PHP 解析 OPML 文件以便我可以将地址导入 mySql 数据库的任何建议?

regex - 为什么空格会导致sed中记住的模式输出不同的东西

c# - 在 ASP.Net 中创建 razor 动态 html 表

zend-framework - Zend RSS 提要 pubDate 时间格式化

pandas - 属性错误 : module 'pandas' has no attribute 'read_xml' or 'to_xml'

linux - 自上次更新人类可读格式的文件以来的时间