diff --git a/itsb.xml b/itsb.xml index feb83d3..cd26bed 100644 --- a/itsb.xml +++ b/itsb.xml @@ -64,16 +64,6 @@ - - Bureau d'Enquêtes et Analyses - France - Aviation - 100 reports/year - - https://www.bea.aero/no_cache/?type=100 - - - Bureau d'Enquêtes sur les Accidents de Transport Terrestre France @@ -265,6 +255,25 @@ + + Bureau d'Enquêtes et Analyses + + France + Aviation + 100 reports/year + + + https://bea.aero/les-enquetes/evenements-notifies/?tx_news_pi1[action]=searchResult&tx_news_pi1[controller]=News&tx_news_pi1[facetAction]=add&tx_news_pi1[facetTitle]=etat_intS&tx_news_pi1[facetValue]=100&cHash=b4645da2a30ec0c83f60069d018b5619 + + article.search-entry + + + bea.xml + + + Japan Transport Safety Board Japan diff --git a/jq/bea.jq b/jq/bea.jq new file mode 100644 index 0000000..0e65b49 --- /dev/null +++ b/jq/bea.jq @@ -0,0 +1,48 @@ +# 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", + "@xmlns": { + "georss": "http://www.georss.org/georss" + }, + "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": [ + .[] + | . 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("
  • ") + | "" + ), + "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(" ")) + } + ] + } + } +}