Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # xkcd Ripper
- #
- # Arkanon <arkanon@lsd.org.br>
- # 2010/10/13 (Qua) 00:08:56 (BRS)
- # 2010/10/12 (Ter) 23:43:14 (BRS)
- n=1 # 1..804
- echo
- while [ "$stt" != 1 ]
- do
- out=$(wget -qO- http://xkcd.com/$n)
- stt=$?
- echo "n=$n"
- eval "echo -e \"$(
- echo "$out" \
- | grep -e "<title>" -e "/comics/.*title" \
- | sed -r '
- s: *<title>[(xkcd: )]*:t=:g
- s:</title>::
- s:.*/([^/]*)":i=\1:
- s:" title=":\nl=:
- s:".*::
- s:&#([0-9]+);:$(echo -e $(printf "\\\\\\x%x" \1)):g
- '
- )\""
- echo
- n=$[$n+1]
- done
- # echo -e $(printf '\\x%x' 39)
- # eval "echo -e \"$(echo "'Petit'\nbeing a reference" | sed -r 's:&#([0-9]+);:$(echo -e $(printf "\\\\\\x%x" \1)):g')\""
- # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement