diff options
Diffstat (limited to 'scripts/geojson/fetch_stations.sh')
-rwxr-xr-x | scripts/geojson/fetch_stations.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/geojson/fetch_stations.sh b/scripts/geojson/fetch_stations.sh new file mode 100755 index 0000000..8b76428 --- /dev/null +++ b/scripts/geojson/fetch_stations.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +json=`curl 'https://wiki.linux-forks.de/mediawiki/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:Stations&cmlimit=1000' 2>/dev/null` +cities=`echo "$json" | json_reformat | sed -n 's/.*"title":\s*"\([^"]*\).*/\1/p' | tr ' ' '_' | tr '\n' ' '` + +echo "[" +for city in $cities; do + ./fetch_single.sh "$city" +done +echo "{}]" |