ANTICHAT

ANTICHAT (https://forum.antichat.io/index.php)
-   PHP (https://forum.antichat.io/forumdisplay.php?f=37)
-   -   Помогите, php+curl+wordpress (https://forum.antichat.io/showthread.php?t=186827)

eniki 14.03.2010 16:21

Помогите, php+curl+wordpress
 
Пишу спамер по wp, в некоторые блоги норм отправляется, а вот в другие не хочет, не пойму почему, помогите пожалуйста разобраться, вот часть кода чисто для теста на блог в который не получается запостить
PHP код:

$ch = curl_init();
$url="http://sovch.chuvashia.com/?p=23218";

$html = ch_get(&$ch, $url);     

$postarray = array('author' => 'name', 
                               
'email' => 'mail@ya.ru', 
                                
'url' => 'google.ru',  
                                
'comment' => 'comment',  
                                
'submit' => 'Отправить',             
                                 
'comment_post_ID' => '23218',  
                                 
'dcaptcha_sess' => '1');

$html = ch_post(&$ch, "http://sovch.chuvashia.com/wp-comments-post.php", $url, $postarray);

curl_close($ch);

echo 
$html;

function 
ch_get($curl, $url)
{
    
curl_setopt($curl, CURLOPT_URL, $url);
    
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
    
curl_setopt($curl, CURLOPT_REFERER, $ref);
    
curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, 1);
    
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
    
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
    return  
$html = curl_exec($curl);
 }




function 
ch_post($curl, $url, $ref, $postdata)
{
    
curl_setopt($curl, CURLOPT_URL, $url);
    
curl_setopt($curl, CURLOPT_REFERER, $ref);
    
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
    
curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, 1);
    
curl_setopt($curl, CURLOPT_COOKIESESSION, 1);
    
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd()."/cookies.txt");
    
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
    
curl_setopt($curl, CURLOPT_POST, 1);
    
curl_setopt($curl,CURLOPT_POSTFIELDS, $postdata);
    return  
$html = curl_exec($curl);
} 


Olegros911 14.03.2010 16:22

ты уверен что именно не отправляет...просто у некоторых стоит антиспам...если интерисует пиши в пм чтоб не обсуждать в пм...раскажу подробности

[stranger] 14.03.2010 16:27

Цитата:

'comment' => 'comment,
надо
Цитата:

'comment' => 'comment',

eniki 14.03.2010 16:29

В post передаётся параметр
'dcaptcha_sess' => '1'
эт типа галочка я не робот,
если этот параметр будет 0 равен, блог будет ругаться что галочка не проставлена.. А если с теми же данными ещё раз запостить, то выведет, что вы уже это говорили.. Хотя на блоге записи нет, модерации ручной тоже нет. Вот думаю мож с реферером или куками не так что-то делаю.

в коде опечатки могут быть, просто скопировал коряво) и это маленькая часть скрипта.


Время: 14:09