Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1.  
  2. <?php
  3. // http://atelier801.com/section?f=7&s=1&s_d=&t_d=&p=4
  4. $forumID    = $_GET['f'];
  5. $sectionID  = $_GET['s'];
  6. $topicID    = $_GET['t'];
  7. $pageNum    = (array_key_exists('p', $_GET)) ? $_GET['p'] : 0;
  8.  
  9.  
  10. while(true){
  11.  
  12. $url  = 'http://atelier801.com/section';
  13. $url .= '?f=' . $forumID;
  14. $url .= '&s=' . $sectionID;
  15. $url .= ($pageNum != null) ? '&p=' . $pageNum : '';
  16.  
  17. $page = file_get_contents($url);
  18.  
  19.  
  20. $regex= '/<a class="nombre-messages([^\"]*)" href="topic\?f=' . $forumID . '&t=' . $topicID . '([^\"]*)">([^<]*)<\/a>/i';
  21.     if(preg_match($regex, $page, $matches))
  22.     {
  23.         //var_dump($matches);
  24.         echo $matches[3];
  25.         break;
  26.     }else{
  27.             $pageNum = $pageNum + 1;
  28.     }
  29.     if($pageNum==70){
  30.         echo '-1';
  31.         break;
  32.     }
  33. }
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement