pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

Bash pastebin - collaborative debugging tool View Help


Posted by Harry on Sat 19 Sep 02:40
report abuse | download | new post

  1. #!/bin/bash
  2. ## 4chan Leecher - By BenLand100, edited by Harry.
  3. ## Highly suggest you remove the echos if you are running as a cron.
  4.  
  5. echo "Welcome; collecting all thread info now."
  6.  
  7. ##begin collecting all threads and image URLs
  8. wget -U "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.7.3) Gecko/20040916" -e robots=off -q -O- http://cgi.4chan.org/s/imgboard.html | egrep "<input type=checkbox name=\"[0-9]*\" value=delete>.*filetitle" | sed "s^.*\"\([0-9]*\)\".*^http://cgi.4chan.org/s/res/\1.html^" >> threads
  9. for ((i=1; i<=10; i++)) do
  10.     wget -U "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.7.3) Gecko/20040916" -e robots=off -q -O- http://cgi.4chan.org/s/$i.html | egrep "<input type=checkbox name=\"[0-9]*\" value=delete>.*filetitle" | sed "s^.*\"\([0-9]*\)\".*^http://cgi.4chan.org/s/res/\1.html^" >> threads
  11. ##end collecting all threads and image URLs
  12.  
  13. done
  14. wget -U "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.7.3) Gecko/20040916" -e robots=off -q -O- -i threads | egrep "<a href=\"http://cgi.4chan.org/s/src/[0-9]+.jpg\" target=\"_blank\">" | sed "s^.*\(http\://cgi.4chan.org/s/src/[0-9]*.jpg\).*^\1^" >> images ##parsing the images URLs to be downloaded
  15.  
  16. echo "Downloading all images now!"
  17.  
  18. wget -U "Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.7.3) Gecko/20040916" -e robots=off -np -c -x -q -i images ##downloading all the fookin images ..... remove -q if you want verbose information.
  19.  
  20. echo "Done downloading all images; have fun!"
  21.  
  22. rm threads ##erasing the temp thread data
  23. rm images ##erasing the temp image urls

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post