Un simple script en perl para sacar un screenshot y subirlo a imageshack.

El codigo :

Código:
#!usr/bin/perl
#DH ScreenShoter 0.1
#Coded By Doddy H
#ppm install http://www.bribes.org/perl/ppm/Win32-GuiTest.ppd
#ppm install http://www.bribes.org/perl/ppm/Crypt-SSLeay.ppd

use Win32::GuiTest
  qw(GetAsyncKeyState GetForegroundWindow GetWindowText FindWindowLike SetForegroundWindow SendKeys);
use Win32::Clipboard;
use Time::HiRes "usleep";
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);

$|++;

my $time;
my $nombrefecha;

my ( $dia, $mes, $anio, $hora, $minutos, $segundos ) = agarrate_la_hora();

$nombrefecha =
    $dia . "_"
  . $mes . "_"
  . $anio . "_"
  . $hora . "_"
  . $minutos . "_"
  . $segundos;

my $se = "captures";

unless ( -d $se ) {
    mkdir( $se, "777" );
}

chdir $se;

head();

print "[+] Save Photo with this name : ";
chomp( my $filename = <stdin> );

print "\n[+] Get Photo in this time : ";
chomp( my $timeop = <stdin> );

print "\n[+] Open photo after taking it ? : ";
chomp( my $load_image = <stdin> );

print "\n[+] Upload image to ImageShack ? : ";
chomp( my $imageshack = <stdin> );

print "\n[+] Taking shot in ";

if ( $timeop eq "" ) {
    $time = 1;
}
else {
    $time = $timeop;
}

for my $num ( reverse 1 .. $time ) {
    print "$num.. ";
    sleep 1;
}

if ( $filename eq "" ) {

    capturar_pantalla( $nombrefecha . ".jpg" );

}
else {

    capturar_pantalla($filename);

}

print "\a\a\a";
print "\n\n[+] Photo Taken\n";

if ( $imageshack =~ /y/ ) {
    if ( $filename eq "" ) {
        subirarchivo( $nombrefecha . ".jpg" );
    }
    else {
        subirarchivo($filename);
    }
}

if ( $load_image =~ /y/ ) {
    if ( $filename eq "" ) {
        system( $nombrefecha. ".jpg" );
    }
    else {
        system($filename);
    }
}

copyright();

## Functions

sub subirarchivo {

    my $your_key = "fuck you";    #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 => [ $_[0] ],
            format     => "json"
        ]
    )->content;

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

sub head {

    my @logo = (
        "#=============================================#", "\n",
        "#             DH ScreenShoter 0.1             #", "\n",
        "#---------------------------------------------#", "\n",
        "# Written By Doddy H                          #", "\n",
        "# Email: lepuke[at]hotmail[com]               #", "\n",
        "# Website: doddyhackman.webcindario.com       #", "\n",
        "#---------------------------------------------#", "\n",
        "# The End ?                                   #", "\n",
        "#=============================================#", "\n"
    );

    print "\n";

    marquesina(@logo);

    print "\n\n";

}

sub copyright {

    my @fin = ("-- == (C) Doddy Hackman 2012 == --");

    print "\n\n";
    marquesina(@fin);
    print "\n\n";

    <stdin>;

    exit(1);

}

sub capturar_pantalla {

    SendKeys("%{PRTSCR}");

    my $a = Win32::Clipboard::GetBitmap();

    open( FOTO, ">" . $_[0] );
    binmode(FOTO);
    print FOTO $a;
    close FOTO;

}

sub marquesina {

    #Effect based in the exploits by Jafer Al Zidjali

    my @logo = @_;

    my $car = "|";

    for my $uno (@logo) {
        for my $dos ( split //, $uno ) {

            $|++;

            if ( $car eq "|" ) {
                mostrar( "\b" . $dos . $car, "/" );
            }
            elsif ( $car eq "/" ) {
                mostrar( "\b" . $dos . $car, "-" );
            }
            elsif ( $car eq "-" ) {
                mostrar( "\b" . $dos . $car, "\\" );
            }
            else {
                mostrar( "\b" . $dos . $car, "|" );
            }
            usleep(40_000);
        }
        print "\b ";
    }

    sub mostrar {
        print $_[0];
        $car = $_[1];
    }

}

sub agarrate_la_hora {

    my ( $a, $b, $c, $d, $e, $f, $g, $h, $i ) = localtime(time);

    $f += 1900;
    $e++;

    return (
        $d, $e, $f, $c, $b, $a

    );

}

## The End ?