Fix date handling in BEA feed
This commit is contained in:
parent
454f3b4608
commit
6d97869d19
46
jq/bea.jq
46
jq/bea.jq
|
@ -18,31 +18,27 @@ import "./helpers" as helpers;
|
|||
"docs": "https://www.rssboard.org/rss-specification",
|
||||
"ttl": 1440,
|
||||
"generator": "ITSB",
|
||||
"item": [
|
||||
.[]
|
||||
| . as $item
|
||||
| {
|
||||
"title": (.children[1].children[1].title | gsub("'"; "'")),
|
||||
"description": (
|
||||
[
|
||||
.children[0].children[1].children[].children
|
||||
| .[0].text + " : " + ((.[1].children[0] | .text // .children[0].text) // .[1].text)
|
||||
| gsub("'"; "'")
|
||||
]
|
||||
| join("</li><li>")
|
||||
| "<ul><li>\(.)</li></ul>"
|
||||
),
|
||||
"link": (.children[1].children[1].href | helpers::urlresolve("https://bea.aero/")),
|
||||
"guid": (.children[1].children[1].href | helpers::urlresolve("https://bea.aero/")),
|
||||
"pubDate": (
|
||||
[(.children[0].children[1].children[].children[].children // [])[].datetime | strings][0]
|
||||
| strptime("%Y-%m-%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
),
|
||||
"georss:point": (.children[2].text | [match("', (-?[0-9.]+), (-?[0-9.]+)") | .captures[].string] | join(" "))
|
||||
}
|
||||
]
|
||||
"item": [.[] | {
|
||||
"title": (.children[1].children[1].title | gsub("'"; "'")),
|
||||
"description": (
|
||||
[
|
||||
.children[0].children[1].children[].children
|
||||
| .[0].text + " : " + ((.[1].children[0] | .text // .children[0].text) // .[1].text)
|
||||
| gsub("'"; "'")
|
||||
]
|
||||
| join("</li><li>")
|
||||
| "<ul><li>\(.)</li></ul>"
|
||||
),
|
||||
"link": (.children[1].children[1].href | helpers::urlresolve("https://bea.aero/")),
|
||||
"guid": (.children[1].children[1].href | helpers::urlresolve("https://bea.aero/")),
|
||||
"pubDate": (
|
||||
[.children[0].children[1].children[].children[].children[]?.children[0].text | strings][0]
|
||||
| strptime("%d/%m/%Y")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
),
|
||||
"georss:point": (.children[2].text | [match("', (-?[0-9.]+), (-?[0-9.]+)") | .captures[].string] | join(" "))
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue