diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-15 17:14:23 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-15 17:14:23 +0200 |
commit | f834111e1fbdfe5e1220bfa01aca4d5035eb8e25 (patch) | |
tree | 88048334910acceed3734c9a867848370f295945 | |
parent | b33b131f963881744b40ee00619299cf8a3fd454 (diff) | |
download | lifomapserver-feature/configurable_geojson.tar.gz lifomapserver-feature/configurable_geojson.tar.bz2 lifomapserver-feature/configurable_geojson.zip |
Add script to fetch ALL pages with coordinatesfeature/configurable_geojson
-rwxr-xr-x | scripts/geojson/fetch_all_points.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/geojson/fetch_all_points.sh b/scripts/geojson/fetch_all_points.sh new file mode 100755 index 0000000..d21b653 --- /dev/null +++ b/scripts/geojson/fetch_all_points.sh @@ -0,0 +1,5 @@ +#!/bin/bash +json=`curl 'https://wiki.linux-forks.de/mediawiki/api.php?action=query&format=json&list=search&redirects=1&converttitles=1&srsearch=%7B%7BCo%7C&srlimit=max&srwhat=text&srprop=snippet'` +echo "[" +echo $json | json_reformat | grep -B 2 'coordinates' | sed -n -e 's#.*o</span>|\([0-9\\-]\+\)|[0-9\\-]*|\([0-9\\-]\+\).*#"geometry": {"type": "Point", "coordinates": [\1,\2]}},#p' -e 's/.*title": "\([^"]*\).*/{ "type": "Feature", "properties": {"name": "\1"},/p' +echo "{}]" |