"; $title_allowable_tags = ""; if (isset($_GET['url'])) { $url = $_GET['url']; $urlparts = parse_url($url); if ($urlparts[path] == "") { $url .= "/"; } if ($fp = @fopen($url, "r")) { while (!feof($fp)) { $data .= fgets($fp, 128); } fclose($fp); } preg_match("%rss:channelTitle *\" *>(.+?)%is", $data, $channelTitleMatches); $channelTitle = htmlentities(strip_tags($channelTitleMatches[1],$allowable_tags)); //if no title can be found then lets just use the title of the page if ($channelTitle == "") { eregi("
(.*) ", $data, $channelTitleMatches); $channelTitle = $channelTitleMatches[1]; } preg_match("%rss:channelDescription *\" *>(.+?)%is", $data, $channelDescriptionMatches); $channelDescription = htmlentities(strip_tags($channelDescriptionMatches[1],$allowable_tags)); $channelLastBuildDate = date("l, F d, Y g:i:s A"); header("Content-Type: text/xml"); $output .= '' . "\n"; $output .= '' . "\n"; $output .= '' . "\n\n"; $output .= '' . "\n"; $output .= ' ' . "\n"; echo $output; } else { ?>' . "\n"; $output .= ' ' . $url . '' . "\n"; $output .= ' ' . "\n"; $output .= '' . htmlentities($channelTitle) . ' ' . "\n"; $output .= '' . htmlentities($channelDescription) . ' ' . "\n"; $output .= 'en-us ' . "\n"; $itemLinkregexp = "%rss:itemLink *\" *>%is"; $match_count = preg_match_all($itemLinkregexp, $data, $itemLinks); $match_count = ($match_count > 25) ? 25 : $match_count; $itemTitleregexp = "%rss:itemTitle *\" *>(.+?)%is"; $match_count = preg_match_all($itemTitleregexp, $data, $itemTitles); $match_count = ($match_count > 25) ? 25 : $match_count; $itemDescregexp = "%rss:itemDescription *\" *>(.+?)%is"; $match_count = preg_match_all($itemDescregexp, $data, $itemDescriptions); $match_count = ($match_count > 25) ? 25 : $match_count; for ($i=0; $i< $match_count; $i++) { $itemLink = $itemLinks[1][$i]; $itemTmpDescription = trim($itemDescriptions[1][$i]); $itemTmpDescription = str_replace("", "
", "", $itemTmpDescription); $itemTmpDescription = str_replace("
", $itemTmpDescription); $itemTmpDescription = str_replace("
", "
", $itemTmpDescription); $itemTmpDescription = str_replace("", "
", "", $itemTmpDescription); $itemTmpDescription = str_replace("
", $itemTmpDescription); $itemTmpDescription = str_replace("
", "
", $itemTmpDescription); $itemDescription = strip_tags($itemTmpDescription,$allowable_tags); //use item title if provided, else generate from description $itemTmpTitle = trim($itemTitles[1][$i]); if ($itemTmpTitle != "") { $itemTitle = strip_tags($itemTmpTitle,$title_allowable_tags); } else { $itemTitle = substr(strip_tags(str_replace("
", " ", $itemDescription),$title_allowable_tags),0,47) . '...'; } $output .= '- ' . "\n"; $output .= '
' . "\n"; } $output .= '' . htmlentities($itemTitle) . ' ' . "\n"; if (strpos('a' . strtolower($itemLink),str_replace(strtolower($url),"http://www.","http://")) != 1) { $itemUrlLink = $url . $itemLink; } else { $itemUrlLink = $itemLink; } $output .= ' ' . htmlentities($itemUrlLink) . '' . "\n"; $output .= '' . htmlentities($itemDescription) . ' ' . "\n"; $output .= 'Baseball Blogs :: makeRSS