Last active
December 18, 2015 00:09
-
-
Save lucaswerkmeister/5694516 to your computer and use it in GitHub Desktop.
Get frames for https://github.com/deplicator/xkcdTime_atyourownpace/
This file contains hidden or 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
#!/bin/sh | |
mkdir data/frames 2> /dev/null # create the images folder, but don't show an error message if it already exists | |
set i=1; # counter | |
set filename=; # file name, not used yet | |
i=1; # actually initialize counter | |
curl --silent geekwagon.net/projects/xkcd1190/data/data.txt | \ | |
while read line; do # for each line in data.txt, do the following: | |
line=`echo $line | tr -d ' '`; # remove all spaces | |
if [ ! "$line" = "" ]; then # check that line is not empty | |
filename="data/frames/$i.png"; | |
if [ ! -f $filename ]; then # check that image does not exist | |
curl --silent $line -o $filename; # write image | |
fi | |
i=`expr $i + 1` # increment counter | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist's content is copied in the ayop wiki, so anyone who changes the gist should also update that page