alieninternet / ais_feed
Textpattern 的内容聚合
v0.1
2024-02-12 03:04 UTC
Requires
- textpattern/installer: *
- textpattern/lock: >=4.8.0
README
功能
- 支持 Atom 和 RSS 聚合
- 允许使用 XPath 查询查询聚合中的任何字段
- 可以按需格式化聚合数据
- 无依赖 - 无需库,使安装简单
- 聚合缓存(基于文件)
示例
以下示例展示了如何使聚合遍历一个聚合,返回最多 5 项,输出自定义字段,并基于 XPath 查询执行简单逻辑。
<txp:ais_feed feed="http://example.com/feed.xml" limit="5"> <article class="article feed"> <h2> <txp:ais_feed_item_link> <txp:ais_feed_item_title /> </txp:ais_feed_item_link> </h2> <p>Posted: <txp:ais_feed_item_posted format="%B %Y" /></p> <p><txp:ais_feed_item_xpath xpath="./custom:field" /></p> <txp:ais_feed_item_if_xpath xpath="./custom:something[@foo='1']"> <p>Something happens when XPath query is true</p> <txp:else /> <p>Something different happens when not true</p> </txp:ais_feed_item_if_xpath> </article> </txp:ais_feed>
完整帮助信息请访问此处,以及插件内部,包括标签说明和实际示例。