Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $html = file_get_contents("http://www.bungie.net/stats/reach/globalchallenges.aspx");
- #file_put_contents("/tmp/globalchallenges.aspx", $html);
- #$html = file_get_contents("/tmp/globalchallenges.aspx");
- rss_header();
- $pos = strpos($html, "<h5>");
- while ($pos !== false) {
- $title = fuckawesomefind($html, "<h5>", "</h5>", $pos);
- $description = fuckawesomefind($html, 'escription">', "</p>", $pos);
- $credits = fuckawesomefind($html, "</span> ", "</p>", $pos);
- rss_item($title, "$description - $credits");
- $pos = @strpos($html, "<h5>", $pos);
- }
- rss_footer();
- function fuckawesomefind($text, $skey, $ekey, &$location = 0) {
- $start_pos = strpos($text, $skey, $location) + strlen($skey);
- $end_pos = strpos($text, $ekey, $start_pos);
- $location = $end_pos;
- return substr($text, $start_pos, $end_pos-$start_pos);
- }
- function rss_header() {
- print '<?xml version="1.0"?>' . "\n";
- print '<rss version="2.0">' . "\n";
- print '<channel>';
- }
- function rss_item($title, $description) {
- print "<item\n";
- print "<title>$title</title>\n";
- print "<description>$description\n</description>\n";
- print "</item>\n";
- }
- function rss_footer() {
- print "</channel>\n";
- print "</rss>\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment