Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Last active December 18, 2015 00:09
Show Gist options
  • Save lucaswerkmeister/5694516 to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/5694516 to your computer and use it in GitHub Desktop.
#!/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;
@lucaswerkmeister
Copy link
Author

This gist's content is copied in the ayop wiki, so anyone who changes the gist should also update that page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment