XPath 1.0 是为资深用户准备的标准查询语言,FreshRSS 用以实现 Web 抓取.
如 //title 或是静态字符串如: "My custom feed"
//title
"My custom feed"
例如 //div[@class="news-item"]
//div[@class="news-item"]
注意使用 XPath 轴 descendant::,例如 descendant::h2
descendant::
descendant::h2
例如使用 . 将整个对象作为文章内容
.
例如 descendant::a/@href
descendant::a/@href
例如 descendant::img/@src
descendant::img/@src
可以是静态字符串,例如 "Anonymous"
"Anonymous"
结果将被 strtotime() 解析
strtotime()
可选项, 格式参见 DateTime::createFromFormat() 例如 d-m-Y H:i:s
DateTime::createFromFormat()
d-m-Y H:i:s
Example: normalize-space(//script[@type="application/json"]) (single JSON)or: //script[@type="application/ld+json"] (one JSON object per article)
normalize-space(//script[@type="application/json"])
//script[@type="application/ld+json"]
JSON 点表达式(JSON 路径)在对象之间使用点,在数组中使用中括号 (例如 data.items[0].title)
data.items[0].title
例如: meta.title 或一个静态的字符串: "My custom feed"
meta.title
包含文章数组的 JSON 路径, 例如 $ or newsItems
$
newsItems
用于找到文章内容的键, 例如 content
content
例如: permalink
permalink
例如: image
image
结果会被 strtotime() 解析
可选项. 被 DateTime::createFromFormat() 支持的日期格式。例如 d-m-Y H:i:s
例:foo=bar; gdpr_consent=true; cookie=value
允许订阅源服务器设置 Cookies(仅在请求期间存储在内存中)
设置为 0 或留空以禁用,-1 表示无限重定向
例:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0)
选择协议(例:SOCKS5)和代理地址(例:127.0.0.1:1080 或者 username:password@127.0.0.1:1080)
如果荷载非空且是合法的 JSON,HTTP 请求标头将被自动设为 application/json,否则使用 application/x-www-form-urlencoded
application/json
application/x-www-form-urlencoded
Headers are separated by a newline, and the name and value of a header are separated by a colon (e.g: Accept: application/atom+xmlAuthorization: Bearer some-token).
Accept: application/atom+xmlAuthorization: Bearer some-token
使用 URL 上的 OPML 文件 中的订阅源填充这一分类