Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use LWP::UserAgent;
- use HTTP::Cookies;
- use warnings;
- use URI::Escape;
- use Encode qw/from_to/;
- use POSIX qw/strftime/;
- $mail = "mail%40domain.ru";
- $pass = "password";
- $noteid = "11138832";
- $browser = LWP::UserAgent->new;
- $cookie = HTTP::Cookies->new( file => 'cookies.cookies', autosave => 1, );
- $browser->cookie_jar($cookie);
- sub str_replace {
- my $replace_this = shift;
- my $with_this = shift;
- my $string = shift;
- my $length = length($string);
- my $target = length($replace_this);
- for(my $i=0; $i<$length - $target + 1; $i++) {
- if(substr($string,$i,$target) eq $replace_this) {
- $string = substr($string,0,$i) . $with_this . substr($string,$i+$target);
- return $string; #Comment this if you what a global replace
- }
- }
- return $string;
- }
- print "\n";
- print "Started.\n";
- print "[*] Auth...";
- $login = $browser->get("http://login.vk.com/?act=login&email=$mail&pass=$pass")->as_string;
- if($login =~ /reg/) {
- print "FAIL";
- #exit(1);
- } else {
- print "DONE\n";
- }
- $ithappens = $browser->get("http://ithappens.ru/random/")->as_string;
- if($ithappens =~ /p class="text">(.*)<\/p>/) {
- $newtext = str_replace('<br>','\n',$1);
- } else {
- print "FAIL!";
- exit(0);
- }
- $sometext = "sometext";
- $somecaption = "somecaption";
- $time = strftime('%H:%M', localtime);
- $text = "
- {|
- |-
- ! $sometext
- !
- |-
- | $newtext \n\n (<b>$time</b>)
- |
- |}";
- print "[*] Fetching action link...";
- $editnote = $browser->get("http://m.vkontakte.ru/editnote$noteid")->as_string;
- if($editnote =~ /action="(.*)"/) {
- $link1 = "http://m.vkontakte.ru$1";
- $link = str_replace('amp;', '', $link1);
- $link = str_replace('amp;', '', $link);
- $link = str_replace('amp;', '', $link);
- print "OK!\n";
- } else {
- print "\nFAIL [Fetching action link]";
- exit(0);
- }
- print "[*] Updating note...";
- $result = $browser->post($link, Content => "title=$somecaption&post=$text")->as_string;
- if($result =~ /\?m=3/) {
- print "OK!\n\n";
- } else {
- print "FAIL\n\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment