From 3d0afc953ee0db0dc1d950724a0f9cd342e15361 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 30 Apr 2020 18:29:53 +0200 Subject: Extract categories, description, and thumbnail from rendered HTML pages --- scripts/geojson/fetch_all_points.sh | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'scripts/geojson/fetch_all_points.sh') diff --git a/scripts/geojson/fetch_all_points.sh b/scripts/geojson/fetch_all_points.sh index 81c46e0..d1ec504 100755 --- a/scripts/geojson/fetch_all_points.sh +++ b/scripts/geojson/fetch_all_points.sh @@ -22,22 +22,9 @@ for line in $data; do fi if [[ "$title" != "" && "$coords" != "" ]]; then echo "{\"type\": \"Feature\", \"properties\": {\"name\": \"$title\"," - echo -n "\"categories\": [" - urltitle=`echo "$title" | sed 's/ /%20/g'` - cjson=`curl -s "https://wiki.linux-forks.de/mediawiki/api.php?action=query&format=json&titles=$urltitle&prop=categories" | json_reformat -m` - categories=`echo "$cjson" | sed -n 's/.*\("categories":[^]]\+\).*/\1/p'`; - IFS='}' - fc="true"; - for entry in $categories; do - if [[ "$fc" != "true" ]]; then - echo -n ","; - fi - category=`echo "$entry" | sed -n 's/.*Category:\([^"]\+\).*/\1/p'` - echo -n "\"$category\""; - fc="false"; - done; - IFS=$'\n' - echo "]},"; + urltitle=`echo "$title" | sed 's/ /_/g'` + ./get_rendered_meta.sh "https://wiki.linux-forks.de/mediawiki/index.php/$urltitle" + echo "},"; echo "\"geometry\": {\"type\": \"Point\", \"coordinates\": [$coords]}},"; title=""; coords=""; -- cgit v1.2.3