#! /usr/bin/perl # Superscript di Gaggo per uppare immagini su tinypic.com # Rimembra, il Gaggo รจ figo. Tu no. use LWP::UserAgent; use HTTP::Request::Common qw(POST); use HTTP::Cookies; $file = shift or die "Usage: tinypic.pl ", "\n"; my $browser = new LWP::UserAgent; $browser->cookie_jar(new HTTP::Cookies); my $response = $browser->get('http://it.tinypic.com/'); my $content = $response->content; # or whatever $content =~ m{name="UPLOAD_IDENTIFIER".+?value="(\w+?)"}ms; my $upload_identifier = $1; print "$upload_identifier", "\n"; $content =~ m{name="upk".+?value="(\w+?)"}ms; my $upk = $1; print "$upk", "\n"; $resp = $browser->post( "http://s4.tinypic.com/upload.php", [ UPLOAD_IDENTIFIER => $upload_identifier, upk => $upk, domain_lang => 'it', action => 'upload', MAX_FILE_SIZE => '200000000', the_file => [$file ,$file, "Content-Type" => "image/gif"], description => 'tinypic', file_type => 'image', dimension => '1600' ], 'Content_Type' => 'multipart/form-data' ); my $risultato = $resp->content; $risultato =~ m{}; my $sito = $1; $response = $browser->get($sito); if ($response->is_success) { $content = $response->content; # or whatever } else { die $response->status_line; } $content =~ m{"direct-url" value="(.+?)" size="39"}; $sito = $1; print "$sito", "\n"; use Tk; # Main Window my $mw = new MainWindow; #GUI Building Area my $ent = $mw -> Entry() -> pack(); $ent -> insert('end', $sito); MainLoop;