Advertisement
kaed

Filenuke index.php - 8/3/13

Aug 4th, 2013
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2.  
  3. $html = file_get_contents('http://www.movie2k.tv/Drinking-Buddies-watch-movie-16747914.html'); //There are 13 links on this page
  4. $scrapedmovie = new DOMDocument();
  5. $previous_value = libxml_use_internal_errors(true);
  6. $scrapedmovie->loadHTML($html);
  7. libxml_clear_errors();
  8. libxml_use_internal_errors($previous_value);
  9.  
  10. /******************
  11.     start: filenuke's code
  12. *******************
  13. // $movieslinks = $scrapedmovie->getElementById('menu')->getElementsByTagName('tr');//get all rows in table with links
  14. // $totalLinks = $movieslinks->length - 1;//how many links we found.  we minus 1 because first row is useless
  15. // //loop and put the quality of movie and link in arrays
  16. // //we skip the 1st row coz its not having anything useful in it (i=1 instead of 0)
  17. // for ($i = 1; $i<$totalLinks + 1; $i++)
  18. // {
  19.         // $movielink[$i - 1] = $movieslinks->item($i)->getElementsbyTagName('a')->item(0)->getAttribute('href');
  20.           // $moviequality[$i - 1] =    $movieslinks->item($i)->getElementsbyTagName('td')->item(1)->getElementsByTagName('img')->item(0)->getAttribute('title');
  21.           // $moviequality[$i - 1] = substr($moviequality[$i - 1], 14,   strlen($moviequality[$i - 1]) - 14);//get rid of useless part of   moviequality string
  22. // }
  23. // echo "<b>Total " . $totalLinks . ' hoster links found.</b><br>';
  24. // print_r($movielink);
  25. // echo "<br>";
  26. // print_r($moviequality);
  27. *******************
  28.     end: filenuke's code
  29. ******************/
  30.  
  31. $count = 0;
  32. $trs = $scrapedmovie->getElementsByTagName('tr');
  33. foreach ($trs as $tr){
  34.     if ($tr->getAttribute('id')=="tablemoviesindex2"){
  35.         echo $tr->getElementsByTagName('a')->item(0)->getAttribute('href') . PHP_EOL;
  36.         $count++;
  37.     }
  38. }
  39. echo 'There are ' . $count . ' matching links.'; //only returns 9
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement