40 lines
1.6 KiB
Plaintext
40 lines
1.6 KiB
Plaintext
# JTSB aviation feed generator (English version) from http://www.mlit.go.jp/jtsb/airrep.html
|
|
# 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": "JTSB Aviation",
|
|
"description": "Japan Transport Safety Board aviation accident reports",
|
|
"link": "http://www.mlit.go.jp/jtsb/airrep.html",
|
|
"language": "en",
|
|
"pubDate": (now | strftime("%a, %d %b %Y %T %z")),
|
|
"docs": "https://cyber.harvard.edu/rss/rss.html",
|
|
"ttl": 86400,
|
|
"generator": "ITSB",
|
|
"item": [.[] | {
|
|
"title": (
|
|
.children[0].children[0].text
|
|
+ " - "
|
|
+ .children[2].children[0].text
|
|
+ " - "
|
|
+ .children[5].children[0].text
|
|
),
|
|
"description": (
|
|
.children[4].children[0].text
|
|
+ " "
|
|
+ .children[5].children[0].text
|
|
+ " operated by "
|
|
+ .children[3].children[0].text
|
|
+ " - "
|
|
+ .children[6].children[0].text
|
|
),
|
|
"link": ("http://www.mlit.go.jp/jtsb/" + .children[-1].children[0].href),
|
|
"pubDate": (try (.children[1].children[0].text | strptime("%Y.%m.%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
|
}]
|
|
}
|
|
}
|
|
}
|