if ($url) { parse_html($url); } else { show_form(); } function show_form() { global $SERVER_NAME, $REQUEST_URI; ?>
This form takes your web page and turns it into RSS 0.92. This is especially useful for Blogger users.
A tip of the hat to Aaron Swartz who came up with the idea and the first implementation.
Notes:
"; $urlparts = parse_url($url); if ($urlparts[path] == "") $url .= "/"; if ($fp = @fopen($url, "r")) { while (!feof($fp)) { $data .= fgets($fp, 128); } fclose($fp); } // print "
"; // print htmlentities($data); eregi(""; } function get_link($desc, $url) { if (stristr($desc, "href")) { $linkurl = stristr($desc, "href"); $linkurl = substr($linkurl, strpos($linkurl, "\"")+1); $linkurl = substr($linkurl, 0, strpos($linkurl, "\"")); $linkurl = trim($linkurl); return $linkurl; } else { return $url; } } ?>(.*) ", $data, $title); $channel_title = $title[1]; $match_count = preg_match_all($itemregexp, $data, $items); $match_count = ($match_count > 25) ? 25 : $match_count; header("Content-Type: text/xml"); $output .= "\n"; $output .= "\n"; $output .= "\n"; $output .= "%HTMLlat1;]>\n"; $output .= "\n"; $output .= " \n"; print $output; // print htmlentities($output); // print "\n"; $output .= " \n"; $output .= "". htmlentities(strip_tags($channel_title)) ." \n"; $output .= " ". htmlentities($url) ."\n"; $output .= "". htmlentities($url) ." via voidstar.com \n"; $output .= "". htmlentities("webmaster@voidstar.com") ." \n"; $output .= "en-us \n"; for ($i=0; $i< $match_count; $i++) { $desc = $items[1][$i]; $title = substr(trim(strip_tags($desc)),0,50) . " ..."; $item_url = get_link($desc, $url); $desc = strip_tags($desc, $allowable_tags); $desc = htmlentities($desc); $output .= "- \n"; $output .= "
\n"; } $output .= "". htmlentities($title) ." \n"; $output .= " ". htmlentities($item_url) ."\n"; $output .= "". $desc ." \n"; $output .= "