You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
624 B
Bash

#!/bin/sh
if [ -n "$1" ]; then
pagetitle=$1
else
echo "Wikipage title not supplied as script argument"
exit
fi
file_wiki=$pagetitle".wiki"
file_icml=$pagetitle".icml"
file_html=$pagetitle".html"
api_querypage="https://pzwiki.wdka.nl/mw-mediadesign/api.php?format=json&action=query&titles="$pagetitle"&prop=revisions&rvprop=content"
echo $api_querypage $file_wiki
curl -s $api_querypage | jq '.query.pages[].revisions[]."*"' | xargs | sed 's/\[\[.*\]\]//g' > $file_wiki
echo `cat $file_wiki` | pandoc -f mediawiki -t html -o $file_html
echo `cat $file_wiki` | pandoc -f mediawiki -t icml -s -o $file_icml
# rm *.wiki