itsb/jq/uzpln.jq

29 lines
1.0 KiB
Plaintext

# ÚZPLN feed generator
# Required arguments:
# $language: Feed language
# $description: Feed description
# $link: Feed link
# Expects pup JSON output holding <tr> 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": ("ÚZPLN (" + $language + ")"),
"description": $description,
"link": $link,
"language": $language,
"pubDate": (now | strftime("%a, %d %b %Y %T %z")),
"docs": "https://cyber.harvard.edu/rss/rss.html",
"ttl": 86400,
"generator": "ITSB",
"item": [.[] | {
"title": (.children[4].text + " - " + .children[2].text),
"link": ("http://www.uzpln.cz" + .children[5].children[0].href),
"pubDate": (.children[0].text | strptime("%Y-%m-%d") | mktime | strftime("%a, %d %b %Y %T %z"))
}]
}
}
}