Код:
<? $mail = "жираф-блог.рф"; //e-mail или логин от контакта $pass = "жирафик няшка"; //пароль от контакта $admin = "";//1- от имени группы (оставьте пустым если от своего имени) $club = "44522809";//если группа то в таком формате -1,а если человек то без - function connect($link,$cookie=null,$post=null){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$link); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_TIMEOUT, 0); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); if($cookie !== null) curl_setopt($ch, CURLOPT_COOKIE, $cookie); if($post !== null) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } $otvet = curl_exec($ch); curl_close($ch); return $otvet; } function bash(){ $res = file_get_contents('http://bash.org.ru/random'); preg_match('#<div class="text">(.*)</div>#U', $res, $str); $str = str_replace('<br>', "jirafnya", $str[1]); $str = str_replace('<br / >', "jirafnya", $str); $str = str_replace('<br />', "jirafnya", $str); $str = str_replace('<br/>', "jirafnya", $str); $str = str_replace(">"," ",$str); $str = str_replace("<"," ",$str); $str = str_replace("""," ",$str); $str = urlencode(iconv('cp1251','utf-8',$str)); $str = str_replace('jirafnya', "%0A", $str); return $str; } $otvet=connect("http://login.vk.com/?act=login&email=$mail&pass=$pass"); If(!preg_match("/hash=(.*?)&/",$otvet,$hash)){ die("Login incorrect"); } $otvet=connect("http://vk.com/login.php?act=slogin&fast=1&hash=".$hash[1]."&s=1"); preg_match("/remixsid=(.*?);/",$otvet,$sid); $cookie = "remixchk=5; remixsid=$sid[1]"; $hash = connect("http://vk.com/wall".$club."",$cookie); preg_match('/post_hash":"(.*?)"/',$hash,$hash); $otvet=connect("http://vk.com/al_wall.php",$cookie,"act=post&al=1&facebook_export=&friends_only=&hash=".$hash[1]."&message=".bash()."¬e_title=&official=".$admin."&status_export=&to_id=".$club."&type=all"); echo "OK"; ?>