1) Script Title: advanced rss ticker
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...rsstickerajax/
3) Describe problem:
I recently downloaded this script in order to have an rss ticker on my personal website. In testing things out via the demo, I can get everything to work when using the CNN and BBC example feeds that came with the code package. However, when I try to add one of my own feeds to the feed key array, the demo.htm ticker stays stuck at "Initializing ticker..."
Obviously, I'm thinking this has something to do with how my own feed is written. The feed is a php script that parses an espn bottom line url into rss 2.0/xml, and the rss ticker would display things as a live scores ticker. The code for the feed is:
PHP Code:
<?
function get_content($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 0);
ob_start();
curl_exec ($ch);
curl_close ($ch);
$string = ob_get_contents();
ob_end_clean();
return $string;
}
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
echo "<rss version=\"2.0\">\n\n";
echo "<channel>\n";
echo "<title>MLB Scores</title>\n";
echo "<link>http://www.mlb.com</link>\n";
echo "<description>MLB Scores</description>\n";
echo "<language>en-us</language>\n";
$content = get_content ("http://sports.espn.go.com/mlb/bottomline/scores");
$content_array=explode("&", $content);
$scorearray = array();
$i=0;
foreach($content_array as $content) {
if (strpos($content, "_left")) {
$equalpos = strpos($content, "=");
$end = strlen($content);
$title = substr($content, ($equalpos+1), $end);
$title = str_replace("^", "", $title);
$title = str_replace("%20", " ", $title);
$title = str_replace("()","(DELAY)", $title);
$title = str_replace(" INNINGS","", $title);
$scorearray[$i]["title"] = $title;
}
if (strpos($content, "_url")) {
$equalpos = strpos($content, "=");
$end = strlen($content);
$url = substr($content, ($equalpos+1), $end);
$url = str_replace("^", "", $url);
$url = str_replace("%20", " ", $url);
$scorearray[$i]["url"] = $url;
$i++;
}
}
foreach($scorearray as $score) {
echo "<item>\n";
echo "<title>".$score["title"]."</title>\n";
echo "<link>".$score["url"]."</link>\n";
echo "</item>\n";
}
echo "</channel>\n";
echo "</rss>\n";
?>
Anyone have any insight as to why things aren't working? Thanks!
Bookmarks