diff --git a/feedgen.sh b/feedgen.sh index 8976e6c..973da11 100755 --- a/feedgen.sh +++ b/feedgen.sh @@ -4,6 +4,7 @@ echo Building to $DIR/feeds mkdir -p $DIR/feeds if ! command -v json2xml >/dev/null 2>&1; then + echo "Adding $DIR/bin to PATH" PATH="$DIR/bin:$PATH" fi @@ -20,3 +21,47 @@ curl -s 'https://www.taic.org.nz/inquiries?order=field_publication_date&sort=des | jq -f $DIR/jq/taic.jq \ | json2xml > $DIR/feeds/taic.xml.new \ && mv $DIR/feeds/taic.xml.new $DIR/feeds/taic.xml + +echo Building JTSB Aviation English feed to $DIR/feeds/jtsb/en/air.xml +mkdir -p $DIR/feeds/jtsb/en +curl -s 'http://www.mlit.go.jp/jtsb/airrep.html' \ + | pup 'table.kankokuiken-en tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/en/air.jq \ + | json2xml > $DIR/feeds/jtsb/en/air.xml.new \ + && mv $DIR/feeds/jtsb/en/air.xml.new $DIR/feeds/jtsb/en/air.xml + +echo Building JTSB Rail English feed to $DIR/feeds/jtsb/en/rail.xml +curl -s 'http://www.mlit.go.jp/jtsb/railrep.html' \ + | pup 'table.kankokuiken-en tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/en/rail.jq \ + | json2xml > $DIR/feeds/jtsb/en/rail.xml.new \ + && mv $DIR/feeds/jtsb/en/rail.xml.new $DIR/feeds/jtsb/en/rail.xml + +echo Building JTSB Marine English feed to $DIR/feeds/jtsb/en/marine.xml +curl -s 'http://www.mlit.go.jp/jtsb/marrep.html' \ + | pup 'table.kankokuiken-en tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/en/marine.jq \ + | json2xml > $DIR/feeds/jtsb/en/marine.xml.new \ + && mv $DIR/feeds/jtsb/en/marine.xml.new $DIR/feeds/jtsb/en/marine.xml + +echo Building JTSB Aviation Japanese feed to $DIR/feeds/jtsb/jp/air.xml +mkdir -p $DIR/feeds/jtsb/jp +curl -s 'https://jtsb.mlit.go.jp/jtsb/aircraft/air-kensaku-list.php?sort=desc&by=p' \ + | pup 'table.jiko-information tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/jp/air.jq \ + | json2xml > $DIR/feeds/jtsb/jp/air.xml.new \ + && mv $DIR/feeds/jtsb/jp/air.xml.new $DIR/feeds/jtsb/jp/air.xml + +echo Building JTSB Rail Japanese feed to $DIR/feeds/jtsb/jp/rail.xml +curl -s 'https://jtsb.mlit.go.jp/jtsb/railway/rail-kensaku-list.php?sort=desc&by=p' \ + | pup 'table.jiko-information tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/jp/rail.jq \ + | json2xml > $DIR/feeds/jtsb/jp/rail.xml.new \ + && mv $DIR/feeds/jtsb/jp/rail.xml.new $DIR/feeds/jtsb/jp/rail.xml + +echo Building JTSB Marine Japanese feed to $DIR/feeds/jtsb/jp/marine.xml +curl -s 'https://jtsb.mlit.go.jp/jtsb/ship/ship-kensaku-list.php?sort=desc&by=p' \ + | pup 'table.jiko-information tr:not(:first-child) json{}' \ + | jq -f $DIR/jq/jtsb/jp/marine.jq \ + | json2xml > $DIR/feeds/jtsb/jp/marine.xml.new \ + && mv $DIR/feeds/jtsb/jp/marine.xml.new $DIR/feeds/jtsb/jp/marine.xml diff --git a/index.html b/index.html index 991a9fc..a906d92 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@
Country | +Japan | +
Languages | +Japanese, English | +
Types | +Rail, aviation, marine | +
Frequency | +
+ Japanese: 100+ reports/year + English: 30-40 reports/year + |
+
Feeds | ++ + | +