Last active
October 14, 2019 22:16
-
-
Save riemers/8c4da147976ec1332692d5ec378806bb to your computer and use it in GitHub Desktop.
Grab all Empires & Puzzles images from the wiki (since those are nice)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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