Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $RST = file_get_contents("https://rstforums.com");
- $RST = explode(" <div id=\"tab-1\">",$RST);
- $RST = explode("</div>",$RST[1]);
- $RST = explode("<li>",$RST[0]);
- unset($RST[0]);
- foreach($RST as $thread){
- $thread = explode("\"",$thread);
- $thr['link'] = $thread[3];
- $tid = explode("t=",$thr['link']);
- $tid = explode("&",$tid[1]);
- $thr['tid'] = $tid[0];
- $pid = explode("p=",$thr['link']);
- $thr['pid'] = $pid[1];
- $title = explode(">",$thread[6]);
- $title = explode("</",$title[1]);
- $thr['title'] = $title[0];
- $author = explode("> ",$thread[10]);
- $author = explode(" </",$author[1]);
- $thr['author'] = $author[0];
- $topic = explode(">",$thread[12]);
- $topic = explode("</",$topic[2]);
- $thr['topic'] = $topic[0];
- $thrs[] = $thr;
- }
- print_r("threads=".json_encode($thrs));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment