Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (10 sloc) 0.491 kb
for i in {1..1266}
do
urli="http://xkcd.com/"$i"/"
wget $urli
l=`cat index.html | grep "Permanent link to this comic: " | cut -d\ -f6 | cut -d\< -f1`
trans=`sed -e '/<div id="transcript" style="display: none">/,/<\/div>/!d' -e 's_</div>$__g' -e 's_^<div id="transcript" style="display: none">__g' index.html | sed ':a;N;$!ba;s/\n/ | /g' | perl -MHTML::Entities -ne 'print decode_entities($_)'`
echo -e $l"\t"$trans >> ../data/transcripts.csv
rm -f index.html
echo $i" done"
done
Jump to Line
Something went wrong with that request. Please try again.