diff --git a/feedgen.sh b/feedgen.sh index c40c730..5eb927a 100755 --- a/feedgen.sh +++ b/feedgen.sh @@ -129,3 +129,24 @@ curl -s 'https://www.bfu-web.de/DE/Publikationen/Untersuchungsberichte/untersuch | jq -f $DIR/jq/bfu/de.jq \ | json2xml > $DIR/feeds/bfu/de.xml.new \ && mv $DIR/feeds/bfu/de.xml.new $DIR/feeds/bfu/de.xml + +log Building UZPLN English feed to $DIR/feeds/uzpln/en.xml +mkdir -p $DIR/feeds/uzpln +curl -s 'http://www.uzpln.cz/en/reports' \ + | pup 'table.table tbody tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/uzpln.jq \ + --arg language 'en' \ + --arg description 'Air Accidents Investigation Institute' \ + --arg link 'http://www.uzpln.cz/en/reports' \ + | json2xml > $DIR/feeds/uzpln/en.xml.new \ + && mv $DIR/feeds/uzpln/en.xml.new $DIR/feeds/uzpln/en.xml + +log Building UZPLN Czech feed to $DIR/feeds/uzpln/cz.xml +curl -s 'http://www.uzpln.cz/zpravy-ln' \ + | pup 'table.table tbody tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/uzpln.jq \ + --arg language 'cz' \ + --arg description 'Ústav pro odborné Zjišťování Příčin Leteckých Nehod' \ + --arg link 'http://www.uzpln.cz/zpravy-ln' \ + | json2xml > $DIR/feeds/uzpln/cz.xml.new \ + && mv $DIR/feeds/uzpln/cz.xml.new $DIR/feeds/uzpln/cz.xml diff --git a/img/rss-czech.gif b/img/rss-czech.gif new file mode 100644 index 0000000..8c329bb Binary files /dev/null and b/img/rss-czech.gif differ diff --git a/index.html b/index.html index 42bb811..8b559ef 100644 --- a/index.html +++ b/index.html @@ -425,7 +425,7 @@ Denmark - Language + Languages Danish, English @@ -454,7 +454,7 @@ Denmark - Language + Languages Danish, English @@ -480,7 +480,7 @@ Germany - Language + Languages German, English @@ -500,6 +500,38 @@ + +

Air Accidents Investigation Institute

+ + + + + + + + + + + + + + + + + + + + + + + +
CountryCzech Republic
LanguagesCzech, English
TypesAviation
Frequency + Czech: 10-20 reports/year
+ English: <1 report/year +
Feeds + + +
diff --git a/jq/uzpln.jq b/jq/uzpln.jq new file mode 100644 index 0000000..c4bd7d2 --- /dev/null +++ b/jq/uzpln.jq @@ -0,0 +1,28 @@ +# ÚZPLN feed generator +# Required arguments: +# $language: Feed language +# $description: Feed description +# $link: Feed link +# 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. + +{ + "rss": { + "@version": "2.0", + "channel": { + "title": ("ÚZPLN (" + $language + ")"), + "description": $description, + "link": $link, + "language": $language, + "pubDate": (now | strftime("%a, %d %b %Y %T %z")), + "docs": "https://cyber.harvard.edu/rss/rss.html", + "ttl": 86400, + "generator": "ITSB", + "item": [.[] | { + "title": (.children[4].text + " - " + .children[2].text), + "link": ("http://www.uzpln.cz" + .children[5].children[0].href), + "pubDate": (.children[0].text | strptime("%Y-%m-%d") | mktime | strftime("%a, %d %b %Y %T %z")) + }] + } + } +}