From be1dc049d63dccd22b60e64a2cf1f27a464b5ee4 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Tue, 14 Apr 2020 18:10:19 +0200 Subject: Initial commit --- scripts/geojson/fetch_cities.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/geojson/fetch_cities.sh (limited to 'scripts/geojson/fetch_cities.sh') diff --git a/scripts/geojson/fetch_cities.sh b/scripts/geojson/fetch_cities.sh new file mode 100755 index 0000000..16e81c1 --- /dev/null +++ b/scripts/geojson/fetch_cities.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:City&cmlimit=100'` +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 "{}]" -- cgit v1.2.3