ANTICHAT

ANTICHAT (https://forum.antichat.io/index.php)
-   Freelance - О Работе (https://forum.antichat.io/forumdisplay.php?f=57)
-   -   Антикапчу прикрутить! (https://forum.antichat.io/showthread.php?t=168994)

MiKS_007 07.01.2010 17:32

Антикапчу прикрутить!
 
PHP код:

<?php

/*НАСТРОЙКИ*/
$start = 1; //стартовая страница
$end = 50; //конечная страница
$text = 'comment'; //текст
$userid = id; //ID пользователя
$password = 'password'; //пароль пользователя
/*НАСТРОЙКИ*/

/*ФУНКЦИОНАЛ*/
function Req($url, $id = false)
{
    global 
$text, $userid, $password;
    
$ch = curl_init($url);
    
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
    
curl_setopt($ch, CURLOPT_COOKIE, 'dle_user_id=' . $userid . '; dle_password=' . md5($password));
    if (
$id)
    {
        
curl_setopt($ch, CURLOPT_POST, 1);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, 'comments=' . urlencode(iconv('windows-1251', 'UTF-8',
            
$text)) . '&name=password&mail=&skin=code4test&post_id=' . $id . '&rndval=' . time());
    }
    
$res = curl_exec($ch);
    return 
$res;
}

for (
$i = $start; $i <= $end; $i++)
{
    echo 
'Parsing page #' . $i . "...\r\n";
    
$list = Req('http://nwcod.com/page/' . $i);
    
preg_match_all("<div id='news-id-(\d+)'>", $list, $m);
    foreach (
$m[1] as $id)
    {
        
$res = Req('http://nwcod.com/engine/ajax/addcomments.php', $id);
        if (!
strpos($res, "alert"))
            echo 
$id . ' - OK!' . "\r\n";
        else
            echo 
$id . ' - Error!' . "\r\n";
    }
}
/*ФУНКЦИОНАЛ*/

?>

Вот скрипт на PHP. Спамит по комментариям определенным текстом, логинится через ID и PASS.

Кто сможет прикрутить антикапчу? Так как администрация поставила капчу на комментарии.


Время: 10:37