# BEA feed generator # Expects pup JSON output holding
tags, outputs xmltodict-compatible JSON # WARNING: Dates are locale-sensitive; the RSS feed might not generate correctly with another locale. import "./helpers" as helpers; { "rss": { "@version": "2.0", "channel": { "title": "BEA", "description": "Rapports d'enquête publiés par le Bureau d'Enquêtes et Analyses", "link": "https://bea.aero", "language": "fr-FR", "pubDate": (now | strftime("%a, %d %b %Y %T %z")), "docs": "https://www.rssboard.org/rss-specification", "ttl": 1440, "generator": "ITSB", "item": [.[] | { "title": (.children[0].children[-1].children[0].title | gsub("'"; "'")), "description": ( "

" + .children[0].children[-1].children[1].text + "

" + ( [ .children[1].children[].children | "
\(.[0].text)
\(.[1].children[0].text)
" ] | join("") | if length then "
\(.)
" else "" end | gsub("'"; "'") ) ), "link": (.children[0].children[-1].children[0].href | helpers::urlresolve("https://bea.aero/")), "guid": (.children[0].children[-1].children[0].href | helpers::urlresolve("https://bea.aero/")) }] } } }