itsb/jq/ie-raiu.jq

29 lines
1.2 KiB
Plaintext

# Ireland Railway Accident Investigation Unit feed generator
# Expects pup JSON output holding div.card-body tags, outputs xmltodict-compatible JSON
# WARNING: Dates are locale-sensitive; the RSS feed might not generate correctly with another locale.
{
"rss": {
"@version": "2.0",
"channel": {
"title": "RAIU",
"description": "Irish Railway Accident Investigation Unit accident reports",
"link": "https://www.raiu.ie/investigations/",
"language": "en-IE",
"pubDate": (now | strftime("%a, %d %b %Y %T %z")),
"docs": "https://www.rssboard.org/rss-specification",
"ttl": 1440,
"generator": "ITSB",
"item": [.[].children | {
"title": .[1].children[0].text,
"link": (.[1].children[0].href | sub("\\[levelPATH\\]"; "https://www.raiu.ie/investigations")),
"guid": {
"@isPermaLink": false,
"#text": .[1].children[0].href
},
"pubDate": (.[0].text | strptime("%d %B %Y") | mktime | strftime("%a, %d %b %Y %T %z"))
}]
}
}
}