msgbox

VK Status

Sep 5th, 2011
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.30 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3.     use LWP::UserAgent;
  4.     use HTTP::Cookies;
  5.     use Text::Iconv;
  6.  
  7.     $mail = '';
  8.     $pass = '';
  9.  
  10.     sub str_replace {
  11.         my $replace_this = shift;
  12.         my $with_this = shift;
  13.         my $string = shift;
  14.         my $length = length($string);
  15.         my $target = length($replace_this);
  16.         for(my $i=0; $i<$length - $target + 1; $i++){
  17.         if(substr($string,$i,$target) eq $replace_this){
  18.                 $string = substr($string,0,$i) . $with_this . substr($string,$i+$target);
  19.                 return $string;
  20.             }
  21.         } return $string;
  22.     }
  23.  
  24.  
  25.     print "\n\nAuth................";
  26.     $browser = LWP::UserAgent->new();
  27.     $cookie = HTTP::Cookies->new( file => 'cookie.txt', autosave => 1, );
  28.     $browser->cookie_jar($cookie);
  29.     $login = $browser->get("http://login.vk.com/?act=login&email=$mail&pass=$pass&from_host=vk.com")->as_string;
  30.     if($login =~ /reg/) {
  31.     print 'fail!\n';
  32.     #exit(1);
  33.     } else {
  34.     print "sucess!\nGetting hash........";
  35.         $hash = $browser->get("http://vk.com/profile.php")->as_string;
  36.         if($hash =~ /info_hash\":\"(.*)\",\"photo_hash/) {
  37.         print "$1\nSend request........";
  38.         $hash = $1;
  39.         $data = $browser->get("http://vk.com/al_profile.php?al=1&act=current_info&info=Hello, Perl!&hash=$hash")->as_string;
  40.         print "request sended. Bye :)\n\n";
  41.         #exit(1);
  42.         } else {
  43.         print 'fail!\n\n'
  44.         #exit(1);
  45.         }
  46.    
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment