[Perl] Imageshack Uploader 0.1

Iniciado por BigBear, 14 Mayo 2013, 20:11 PM

0 Miembros y 1 Visitante están viendo este tema.

BigBear

Un simple script para subir imagenes a Imageshack.

El codigo :

Código (perl) [Seleccionar]

#!usr/bin/perl
#Imageshack Uploader 0.1
#Coded By Doddy H
#ppm install http://www.bribes.org/perl/ppm/Crypt-SSLeay.ppd

use LWP::UserAgent;

my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);

head();

unless ( $ARGV[0] ) {
    print "\n[+] Sintax : $0 <image>\n";
}
else {

    my $your_key = "YOURKEY";    #Your API Key

    print "\n[+] Uploading ...\n";

    my $code = $nave->post(
        "https://post.imageshack.us/upload_api.php",
        Content_Type => "form-data",
        Content      => [
            key        => $your_key,
            fileupload => [ $ARGV[0] ],
            format     => "json"
        ]
    )->content;

    if ( $code =~ /"image_link":"(.*?)"/ ) {
        print "\n[+] Link : " . $1 . "\n";
    }
    else {
        print "\n[-] Error\n";
    }
}

copyright();

sub head {
    print "\n-- == Imageshack Uploader 0.1 == --\n";
}

sub copyright {
    print "\n[+] Written By Doddy H\n";
}

#The End ?