По традиции счетчик до нового года на стене Вконтакте. Отображает информацию на картинке. Баны за работу скрипта вроде как не выдаются.
В архиве
лежат различные фоны и шрифт. Если вы запускаете скрипт через PHP-Launcher, то файлы bkgrnd.PNG и tahoma.ttf должны лежать в папке C:\PHP-Launcher\php\. Только после этого скрипт будет нормально работать.
Код:
<?php error_reporting(0); $mail = "qweqwe@gmail.com"; //e-mail или логин от контакта $pass = "zxczxc"; //пароль от контакта $text = "С новым годом!"; //сообщение при наступлении события $textx = "Обновление каждую минуту ^_^"; //текст рядом с счетчиком $sleep = "60"; //интервал между обновлениями в секундах $dir = "C:\PHP-Launcher\php\\"; //папка с файлами из count.zip $key="12345"; //ключ antigate.com $res=curl('http://login.vk.com/?act=login&email='.urlencode($mail).'&pass='.urlencode($pass), null, null, '1'); preg_match("/Location: (.*?)\r\n/",$res,$location); $res=curl($location[1], null, null, '1'); preg_match("/remixsid=(.*?);/",$res,$cookie); $res=curl("http://vk.com/feed.php",$cookie[0]); preg_match("/id=([0-9]+),/",$res,$mid); $res=curl("http://vk.com/wall$mid[1]",$cookie[0]); preg_match("/post_hash\":\"(.*?)\"/",$res,$post_hash); $text=iconv('cp1251','utf-8',$text); $textx=iconv('cp1251','utf-8',$textx); $textx=urlencode($textx); while(1) { $secondsDiff = mktime('0','0','0','1','1','2013') - time(); if(substr_count($secondsDiff,"-")) { $res=curl("http://vk.com/al_wall.php",$cookie[0],"act=post&al=1&hash=$post_hash[1]&message=$text&to_id=$mid[1]&type=full_all"); exit; } else { if($deletePost[1]) { curl("http://vk.com/al_wall.php",$cookie[0],"act=delete&al=1&from=wall&hash=$deletePost[1]&post=$mid[1]_$post_id[1]&root=0"); $res=curl("http://m.vk.com/photo$mid[1]_$photo_id[1]",$cookie[0]); preg_match("/hash=(.*?)\"/",$res,$del_hash); curl("http://vk.com/al_photos.php",$cookie[0],"act=delete_photo&al=1&hash=$del_hash[1]&photo=$mid[1]_$photo_id[1]&set_prev=&sure=0"); } $remainingDay=floor($secondsDiff/60/60/24); $remainingHour=floor(($secondsDiff-($remainingDay*60*60*24))/60/60); $remainingMinutes=floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))/60); if(strlen($remainingDay) < 2) { $remainingDay="0$remainingDay"; } if(strlen($remainingHour) < 2) { $remainingHour="0$remainingHour"; } if(strlen($remainingMinutes) < 2) { $remainingMinutes="0$remainingMinutes"; } $image = imagecreatetruecolor('300','100'); $bkgrnd = imagecreatefrompng($dir.'bkgrnd.png'); imagecopy($image,$bkgrnd,0,0,0,0,'300','100'); imagettftext($image, 50, 0, 13, 60, imagecolorallocate($image, 255, 255, 255), $dir.'tahoma.ttf',$remainingDay); imagettftext($image, 50, 0, 113, 60, imagecolorallocate($image, 255, 255, 255), $dir.'tahoma.ttf',$remainingHour); imagettftext($image, 50, 0, 213, 60, imagecolorallocate($image, 255, 255, 255), $dir.'tahoma.ttf',$remainingMinutes); imagejpeg($image,$dir.'photo.jpg',100); $res=curl("http://vk.com/photos.php",$cookie[0],"act=a_choose_photo_box&al=1&mail_add=&scrollbar_width=16&to_id=$mid[1]"); preg_match("/\"hash\":\"(.*?)\",\"rhash\":\"(.*?)\"/",$res,$hash); preg_match("/server: ([0-9]+),/",$res,$server); $res=curl("http://cs$server[1].vk.com/upload.php?act=do_add&aid=-14&gid=0&mid=$mid[1]&hash=$hash[1]&rhash=$hash[2]&vk=1&from_host=vk.com&ajx=1",$cookie[0],array('photo'=>'@'.$dir.'photo.jpg')); preg_match("/hash\":\"(.*?)\"/",$res,$photo_hashx); preg_match("/photos\":\"(.*?)}/",$res,$photo_id); $photo_id=str_replace("\\","",$photo_id[1]); $res=curl("http://vk.com/al_photos.php",$cookie[0],"act=choose_uploaded&al=1&mid=$mid[1]&aid=-14&gid=0&server=$server[1]&photos=$photo_id%7D%5D&hash=$photo_hashx[1]"); preg_match("/<!>0<!>$mid[1]_([0-9]+)<!><!json>/",$res,$photo_id); $res=curl("http://vk.com/al_wall.php",$cookie[0],"act=post&al=1&attach1=$mid[1]_$photo_id[1]&attach1_type=photo&hash=$post_hash[1]&message=$textx&to_id=$mid[1]&type=full_all"); preg_match('#([0-9]+)<!><!>([0-9]+)<!>([0-9]+)<!>([0-9]+)<!>#', $res, $m); if($m[4]=="2") { print("captcha!\n"); preg_match("/<!>$m[3]<!>2<!>([0-9]+)<!>0/",$res,$csid); file_put_contents($dir.'captcha.jpg',file_get_contents('http://vk.com/captcha.php?sid='.$csid[1])); while(1) { $res=curl("http://antigate.com/in.php",'',array('method'=>'post','is_russian'=>'1','key'=>$key,'file'=>'@'.$dir.'captcha.jpg')); if($res=="ERROR_KEY_DOES_NOT_EXIST" or $res=="ERROR_WRONG_USER_KEY") { die("antigate key error\n"); } if($res!=="ERROR_NO_SLOT_AVAILABLE") { $ckey=str_replace("OK|","",$res); sleep('2'); while(1) { $res=curl("http://antigate.com/res.php?key=$key&action=get&id=$ckey",''); if($res=="ERROR_NO_SUCH_CAPCHA_ID") { $delid="1"; break; } if(substr_count($res,"OK")) { $canswer=str_replace("OK|","",$res); break; } else { sleep('3'); } } } else { continue; } if($delid=="1") { $delid="0"; continue; } else { $res=curl("http://vk.com/al_wall.php",$cookie[0],"act=post&al=1&captcha_sid=$csid[1]&captcha_key=$canswer&attach1=$mid[1]_$photo_id[1]&attach1_type=photo&hash=$post_hash[1]&message=$textx&to_id=$mid[1]&type=full_all"); preg_match('#([0-9]+)<!><!>([0-9]+)<!>([0-9]+)<!>([0-9]+)<!>#', $res, $m); if($m[4]=="2") { curl("http://antigate.com/res.php?key=$key&action=reportbad&id=$ckey",''); preg_match("/<!>$m[3]<!>2<!>([0-9]+)<!>0/",$res,$csid); file_put_contents($dir.'captcha.jpg',file_get_contents('http://vk.com/captcha.php?sid='.$csid[1])); continue; } break; } } } print("send\n"); preg_match("/<!>$m[2]<!>$m[3]<!>$m[4]<!><div id=\"post$mid[1]_([0-9]+)\"/",$res,$post_id); preg_match("/deletePost\(\'$mid[1]_$post_id[1]\', '(.*?)\'/",$res,$deletePost); } sleep($sleep); } function curl($link, $cookie, $post=null, $header=null) { $ch = curl_init($link); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIE, $cookie); if($header) { curl_setopt($ch, CURLOPT_HEADER, 1); } curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0"); if($post) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } $res = curl_exec($ch); curl_close($ch); return $res; } ?>