Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require ('parse/phpQuery.php');
- //Тред донор
- $thread = file_get_contents('https://2ch.hk/me/res/370128.html');
- $document = phpQuery::newDocument($thread);
- $dir = 'img/';
- $files = scandir($dir);
- foreach ($files as $file):
- $rand = rand(1, 394);
- $randimage = rand(1, 577);
- $postMessage = $document->find('blockquote.post-message:eq('. $rand .')');
- $postMessage->find('a')->remove();
- $postMessage = trim(preg_replace('/\s{2,}/', ' ', $postMessage));
- echo $postMessage;
- $url = 'https://2ch.hk/makaba/posting.fcgi';
- // Данные
- $postData['task'] = 'post';
- $postData['board'] = 'asylum';
- $postData['thread'] = '497842';
- $postData['comment'] = strip_tags($postMessage);
- $postData['image'] = '@img/'.$files[$randimage];
- // инициализация cUrl
- $ch = curl_init();
- // Куда отправим
- curl_setopt($ch, CURLOPT_URL, $url);
- // Отправка
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
- // Ответ сервера
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- // Отладка
- curl_setopt($ch, CURLOPT_VERBOSE, true);
- // Отправка запроса
- $response = curl_exec($ch);
- // Отладка
- echo $response;
- // Таймаут для одного потока
- sleep(20);
- endforeach;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement