script 4chan wallaper downloader


SUBMITTED BY: Guest

DATE: April 1, 2013, 7:40 p.m.

FORMAT: Text only

SIZE: 1.5 kB

HITS: 1112

  1. #!/bin/bash
  2. #Choose your Board:
  3. BOARD="wg"
  4. echo "Getting all thread-locations from \\$BOARD\\"
  5. for ((i=0; i<=10; i++)) do
  6. wget -U "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8" -e robots=off -q -O- http://cgi.4chan.org/$BOARD/$i.html | grep -E "<input type=checkbox name=\"[0-9]*\" value=delete>.*filetitle" | sed "s^.*\"\([0-9]*\)\".*^http://cgi.4chan.org/$BOARD/res/\1.html^" >> threadlist
  7. echo "Threads on page " $i " added to threadlist"
  8. done
  9. echo "Threadlist from \\$BOARD\\ complete"
  10. echo "------------------------------------------------------"
  11. echo "Getting all image-locations, this can take a while"
  12. wget -U "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8" -e robots=off -q -O- -i threadlist | grep -E "<a href=\"http://images.4chan.org/$BOARD/src/[0-9]+.jpg\" target=\"_blank\">" | sed "s^.*\(http\://images.4chan.org/$BOARD/src/[0-9]*.jpg\).*^\1^" >> imagelist
  13. echo "Imagelist complete"
  14. rm threadlist
  15. echo "------------------------------------------------------"
  16. echo "Downloading all images from \\$BOARD\\"
  17. wget -U "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8" -e robots=off -np -x -nc -c -i imagelist
  18. rm imagelist

comments powered by Disqus