perl imageshack img stealer

Discussion in 'Archives' started by mu-b, Jun 27, 2009.

perl imageshack img stealer
  1. Unread #1 - Jun 27, 2009 at 2:30 PM
  2. mu-b
    Joined:
    Jun 24, 2009
    Posts:
    1,353
    Referrals:
    2
    Sythe Gold:
    0

    mu-b War is a Drug
    Banned

    perl imageshack img stealer

    Code:
    foreach my $number ("0" .. "100") {
    #Url to search images on.
    my $url = "http://img301.imageshack.us/my.php?image=$number.jpg";
    
    #Request webpage
    $mech->get( $url );
    
    #Search for links containing .jpg or .jpeg extensions
    #in the url.
    #Everything in between qr/ / is what to search for
    #The . means any character usually but we use \ to escape it
    # and make it literal. Then we did (jpe?g) which means to search for
    #the text jpg or jpeg.
    # The $ character means the end of the line/string.
    # The i at the end means make everything case insensitive
     
    my $link;
    if ($link = $mech->find_link(tag => "a", url_regex => qr/\.(jpe?g)$/i)) {
        $mech->get($link);
    
        my $lurl = $link->url;
       
        #Take done.php?l=img301 out of the URL and replace with img301/
        $lurl =~ s/done\.php\?l\=img301\//img301\//;
       
        #Save image to file
        $mech->get( $lurl, ":content_file" => "$number.jpg");
    }
    else {
        print "Image $number.jpg not found\n";
       }
    }
    it's suppose to take images from imageshack, but i put an error somewhere to test it and i took to many $links out so now it works, but it gets errors every so often. If you want to fix it post the new code. If not, you can use it put it won't work every time you try and run it.

    run ---> Via - perl
     
  3. Unread #2 - Jun 28, 2009 at 9:51 PM
  4. FartKnocker
    Joined:
    Sep 3, 2007
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    5

    FartKnocker Forum Addict

    perl imageshack img stealer

    By 'steal', do you mean just recapture the image and save on local server?
     
  5. Unread #3 - Jun 29, 2009 at 12:56 AM
  6. mu-b
    Joined:
    Jun 24, 2009
    Posts:
    1,353
    Referrals:
    2
    Sythe Gold:
    0

    mu-b War is a Drug
    Banned

    perl imageshack img stealer

    exactly.
     
  7. Unread #4 - Jun 29, 2009 at 9:47 PM
  8. FartKnocker
    Joined:
    Sep 3, 2007
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    5

    FartKnocker Forum Addict

    perl imageshack img stealer

    Hm. Thanks, this could come in handy sometime.

    Cheers :).
     
< Sin666 | Selling some unwanted items. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site