36 lines
1.4 KiB
Plaintext
36 lines
1.4 KiB
Plaintext
# JTSB marine feed generator (Japanese version) from https://jtsb.mlit.go.jp/jtsb/ship/ship-kensaku-list.php?sort=desc&by=p
|
||
# 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 船舶報告",
|
||
"description": "運輸安全委員会 船舶報告",
|
||
"link": "https://jtsb.mlit.go.jp/jtsb/ship/ship-kensaku-list.php",
|
||
"language": "ja-JP",
|
||
"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[3].children[0].text
|
||
),
|
||
"description": (
|
||
.children[3].text
|
||
+ " "
|
||
+ .children[2].text
|
||
+ " "
|
||
+ .children[1].text
|
||
),
|
||
"link": .children[4].children[2].href,
|
||
"pubDate": (try (.children[4].text | sub("[^0-9]"; ""; "g") | strptime("%Y%m%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||
}]
|
||
}
|
||
}
|
||
}
|