Показать сообщение отдельно

  #4  
Старый 26.05.2009, 20:41
waweb
Новичок
Регистрация: 16.06.2006
Сообщений: 5
С нами: 10475303

Репутация: 7
По умолчанию

вот скрипт но он крива работает
PHP код:
<?php
set_time_limit
(0);
$to = "1"; // kuda perevesti 

function curl($url,$post) 
{ 
//echo "$url | $post <br>\n";
    
$cfile = 'cookies.txt'; 
    
$ch = curl_init(); 
    
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    
curl_setopt($ch, CURLOPT_URL, $url); 
    
curl_setopt($ch, CURLOPT_HEADER, 1); 
    
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
    
curl_setopt($ch, CURLOPT_COOKIEJAR, $cfile);  
    
curl_setopt($ch, CURLOPT_COOKIEFILE, $cfile);  
    
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 
    
curl_setopt($ch, CURLOPT_POST, 1); 
    
$result = curl_exec($ch); 
    
curl_close($ch);  
    return 
$result; 
     
}; 

function 
transfer_vote($email,$pass,$to){
$result = curl("http://vkontakte.ru/login.php","email=$email&pass=$pass"); 
$result = curl("http://vkontakte.ru/app577176","");
preg_match("/viewer_id\", \"(.*?)\"/i", $result, $user_id);
preg_match("/balance = (.*?);/i", $result, $vote);
preg_match("/join(.*?)'>/i", $result, $appsl);
preg_match("/app_id = (.*?);/i", $result, $app_id);
preg_match("/app_hash = '(.*?)';/i", $result, $app_hash);
preg_match("/app_hash: '(.*?)',/i", $result, $app_hashh);
$result = curl("http://vkontakte.ru/apps.php?act=join&".$appsl['1'],""); 
$result = curl("http://vkontakte.ru/apps.php?act=a_settings".$appsl['1'],"app_id=".$app_id['1']."&app_hash=".$app_hashh['1']."&cn=0&caf=0&caph=0&caa=0&add=".$vote['1']."&withdraw=0");
$result = curl("http://misc.roboxchange.com/External/VKontakte/TransferVotes/Transfer.aspx?idFrom=".$user_id['1']."&idTo=".$to,"");
preg_match("/__VIEWSTATE\" value=\"(.*?)\" \/>/i", $result, $__VIEWSTATE);
preg_match("/__EVENTVALIDATION\" value=\"(.*?)\" \/>/i", $result, $__EVENTVALIDATION);
$result = curl("http://misc.roboxchange.com/External/VKontakte/TransferVotes/Transfer.aspx?idFrom=".$user_id['1']."&idTo=".$to,"__VIEWSTATE=".urlencode($__VIEWSTATE['1'])."&__EVENTVALIDATION=%2FwEWAgKkgLGFCQKSotaICw5O3NZ4fg%2BPn6JIHO469gKHlZqS&btn1=%D0%9F%D1%80%D0%BE%D0%B4%D0%BE%D0%BB%D0%B6%D0%B8%D1%82%D1%8C");
preg_match("/<br><br>(.*?)<br><br>/i", $result, $res);
return 
$res['1'];
}


$aks = file("votes.txt");
foreach(
$aks as $k => $v){
$ak = explode(":", trim($v));
echo 
transfer_vote($ak['0'],$ak['1'],$to)."<br>";
}
?>
 
Ответить с цитированием