Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

optimisizing my code

Name: Anonymous 2011-04-19 10:29



#!/bin/sh

#huge piece of shit thread image downloader and watcher
#to use just "dumper urlofthread"
#it will stop when the thread 404's or you break with ^c

loop=loop
looper() {

newimage() {
image=`echo $1 | perl -nle 'm/(\d+\.[jpg][pni][gf])/; print $1'`
if [[ -e $image ]]
then return
else wget -q $1 && echo "$image aquired."
images=found
fi
}

for x in `curl -s $1 | perl -nle 'm/.*(http\:\/\/images\.4chan\.org\/.?.?.?\/src\/[0123456789]*\.jpg).*/;print $1' | uniq`;do newimage ${x};done

if curl -s $1 | perl -nle 'm/.*4chan.?-.?(404).*/; print $1' | uniq | grep 404
then
echo 'The thread died.'
exit
fi

if [[ $images = found ]]

then
echo 'Checking for new images every 15 seconds.'
images=notfound
sleep 15;
else
sleep 15;
fi
}

while true; do looper $1;done


I've trimmed this a fair bit. Is there anything else ?

Name: anonymous@eecs.berkeley.edy 2011-04-19 11:14

You should be banned from the internet. Seriously. Go back to working your hourly job.

Name: Anonymous 2011-04-19 13:01

>>2
fuck off and die, fag

Name: Anonymous 2011-04-19 15:35

>>3
I could write this shit better in C++.

Name: Anonymous 2011-04-19 16:31

>>4
then do it faggot instead of being a whiny bitch

http://en.wikipedia.org/wiki/User:MZMcBride/Don%27t_be_a_whiny_bitch

Name: Anonymous 2011-04-19 17:31

what the..

#!/bin/bash
curl -s "$@" | egrep -o '>File( : )?<a href="http://.*;(jpg|png|gif)" target="' | cut -d"\"" -f2 | wget -nv -i -

Name: Anonymous 2011-04-19 19:07

>>6
DONT RUN THIS. ITS A VIRUS IT ERASED MY COMPUTER WTF

Name: Anonymous 2011-04-19 19:50

>>6 hey i can use this to fullfill my dream of downloading the internet. and with FrozenVoid's infinite compression algorith i can save it on a sd card. thanks 6-san!!!!!!

Name: Anonymous 2011-04-19 20:35

PUSSY ASS PUSSY

Name: Anonymous 2011-04-20 12:13

>>9
back to /prog/

Name: Anonymous 2011-04-20 15:01

>>10
shut ya fart hole nigga

Don't change these.
Name: Email:
Entire Thread Thread List