Skip to content

Instantly share code, notes, and snippets.

@riemers
Last active October 14, 2019 22:16
Show Gist options
  • Save riemers/8c4da147976ec1332692d5ec378806bb to your computer and use it in GitHub Desktop.
Save riemers/8c4da147976ec1332692d5ec378806bb to your computer and use it in GitHub Desktop.
Grab all Empires & Puzzles images from the wiki (since those are nice)
for ((i=1;i<=2240;i++)); # change 2240 if page id's of the wiki has increased
do
URL=$(curl -s "https://empiresandpuzzles.fandom.com/api/v1/Articles/AsSimpleJson?id=$i" | jq '..|.src?'|grep Hero_Card|sed -r 's/\/revision\/latest\/.*/\"/g')
if [[ "$URL" != "" ]]
then
URLLOWER=$(echo ${URL,,}|sed -r 's/_-_hero_card//g'|sed 's/_/ /g')
echo "curl ${URL} > \"${URLLOWER##*/}"
fi
unset URL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment