eniki
14.03.2010, 16:21
Пишу спамер по wp, в некоторые блоги норм отправляется, а вот в другие не хочет, не пойму почему, помогите пожалуйста разобраться, вот часть кода чисто для теста на блог в который не получается запостить
$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);
}
$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);
}