summaryrefslogtreecommitdiff
path: root/scripts/geojson/fetch_all_points.sh
diff options
context:
space:
mode:
authorMarkus Koch <markus@notsyncing.net>2020-04-30 18:29:53 +0200
committerMarkus Koch <markus@notsyncing.net>2020-04-30 18:29:53 +0200
commit3d0afc953ee0db0dc1d950724a0f9cd342e15361 (patch)
tree0574a3c79f3b1db853c7424224a6c342e7fa470a /scripts/geojson/fetch_all_points.sh
parent9bdb4095a7b465d8332c3dfe60da66805e877ca5 (diff)
downloadlifomapserver-3d0afc953ee0db0dc1d950724a0f9cd342e15361.tar.gz
lifomapserver-3d0afc953ee0db0dc1d950724a0f9cd342e15361.tar.bz2
lifomapserver-3d0afc953ee0db0dc1d950724a0f9cd342e15361.zip
Extract categories, description, and thumbnail from rendered HTML pages
Diffstat (limited to 'scripts/geojson/fetch_all_points.sh')
-rwxr-xr-xscripts/geojson/fetch_all_points.sh19
1 files changed, 3 insertions, 16 deletions
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="";