PDA

View Full Version : Advanced RSS Ticker Problem



ehartnett00
08-09-2006, 02:51 PM
1) Script Title: Advanced RSS Ticker (Ajax Invocation)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm

3) Describe problem: I'm trying to get the RSS Ticker to work and like several others on the message board can get the demo to work but am getting "Error fetching remote RSS feed!" when I try to add other feeds. It does not say "Sorry: It's not possible to reach RSS file ..." as others have posted. I'd post a link but I am currently only trying it out on a laptop with IIS. Following a suggestion on another post I checked to make sure that allow_url_fopen is on and it is. Because I am using a windows system I cannot set the cache directory to "chmod 777." Is there a way to do this in Windows? Could this be my problem?

I'm also getting two notices: "Notice: Undefined index: lastBuildDate in c:\inetpub\wwwroot\lastrss\lastRSS.php on line 159"

and

"Notice: strtotime() [function.strtotime]: Called with empty time parameter in c:\inetpub\wwwroot\lastrss\lastRSS.php on line 159."

if that helps.

Thanks.

jr_yeo
08-09-2006, 03:10 PM
could u post here ur lastRSS.php, bridge.php, rssticker.js and main page? also could u post the name of the other feeds u tried adding. i tried rss ticker on windows local web server only and it works for me. :cool:

ehartnett00
08-09-2006, 04:05 PM
The directory structure I have set up is:
demo.htm
js/rssticker.js
lastrss/lastRSS.php
lastrss/bridge.php
lastrss/cache/

Here is my bridge.php

<?php

/*
======================================================================
LastRSS bridge script- By Dynamic Drive (http://www.dynamicdrive.com)
Communicates between LastRSS.php to Advanced Ajax ticker script using Ajax. Returns RSS feed in XML format
Created: Feb 9th, 2006. Updated: Feb 9th, 2006
======================================================================
*/

header('Content-type: text/xml');

// include lastRSS
include "lastRSS.php"; //path to lastRSS.php on your server from this script ("bridge.php")

// Create lastRSS object
$rss = new lastRSS;
$rss->cache_dir = 'cache'; //path to cache directory on your server from this script. Chmod 777!
$rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input.

// List of RSS URLs
$rsslist=array(
"LRC_News" => "http://ntcclibrary.wordpress.com/feed/",
"CNN" => "http://rss.cnn.com/rss/cnn_topstories.rss",
"BBC" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml",
"news.com" => "http://news.com.com/2547-1_3-0-5.xml",
"slashdot" => "http://rss.slashdot.org/Slashdot/slashdot",
"dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new"
);

////Beginners don't need to configure past here////////////////////

$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list.");

// -------------------------------------------------------------------
// outputRSS_XML()- Outputs the "title", "link", "description", and "pubDate" elements of an RSS feed in XML format
// -------------------------------------------------------------------

function outputRSS_XML($url) {
global $rss;
$cacheseconds=(int) $_GET["cachetime"]; //typecast "cachetime" parameter as integer (0 or greater)
$rss->cache_time = $cacheseconds;
if ($rs = $rss->get($url)) {
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<rss version=\"2.0\">\n<channel>\n";
foreach ($rs['items'] as $item) {
echo "<item>\n<link>$item[link]</link>\n<title>$item[title]</title>\n<description>$item[description]</description>\n<pubDate>$item[pubDate]</pubDate>\n</item>\n\n";
}
echo "</channel></rss>";
if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
}
else {
echo "Sorry: It's not possible to reach RSS file $url\n<br />";
// you will probably hide this message in a live version
}
}

// ===============================================================================

outputRSS_XML($rssurl);

?>

Here is the code for demo.htm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Advanced RSS Ticker (Ajax invocation) demo</title>

<script src="js/rssticker.js" type="text/javascript">

/***********************************************
* Advanced RSS Ticker (Ajax invocation)- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<style type="text/css">

/*Sample CSS to style the two tickers in the demo*/

.cnnclass{
width: 22%;
padding: 5px;
background-color: #F3F3F3;
border: 1px solid black;
margin-bottom: 1em;
filter:progid:DXImageTransform.Microsoft.alpha(opacity=80); /*Specify fade effect in IE. Remove if desired.*/
-moz-opacity: 0.8; /*Specify fade effect in Firefox. Remove if desired.*/
}

.cnnclass a{
text-decoration: none;
}

.bbcclass{
width: 22%;
padding: 6px;
background-color: lightyellow;
border: 1px solid #004A00;
filter:progid:DXImageTransform.Microsoft.alpha(opacity=80); /*Specify fade effect in IE. Remove if desired.*/
-moz-opacity: 0.8; /*Specify fade effect in Firefox. Remove if desired.*/
}

.rsstitle{ /*shared class for all title elements in an RSS feed*/
font-weight: bold;
}

.rssdate{ /*shared class for all date elements in an RSS feed*/
color: gray;
font-size: 85%;
}

.rssdescription{ /*shared class for all description elements in an RSS feed*/
}

</style>

</head>
<body>

<div style="height: 225px">
<script type="text/javascript">
//rssticker_ajax(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
//1) RSS_id: "Array key of RSS feed in PHP script"
//2) cachetime: Time to cache the feed in minutes (0 for no cache)
//3) divId: "ID of DIV to display ticker in. DIV dynamically created"
//4) divClass: "Class name of this ticker, for styling purposes"
//5) delay: delay between message change, in milliseconds
//6) optionalswitch: "optional arbitrary" string to create additional logic in call back function

document.write("LRC News:")
new rssticker_ajax("LRC_News", 0, "lrcbox", "cnnclass", 3000, "date")

//document.write("<br />BBC News: (Title+date+description shown)")
new rssticker_ajax("BBC", 1200, "ddbox", "bbcclass", 3500, "date+description")

document.write("<br />News:")
new rssticker_ajax("news.com", 1200, "newsbox", "cnnclass", 3000, "date")
</script>
</div>

<a href="http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/">Advanced RSS Ticker</a>.

</body>

</html>

The only line I changed in rssticker.js is the URL.


//Relative URL syntax:
var lastrssbridgeurl="../lastrss/bridge.php"


I did not make any changes to lastRSS.php but I can post the code for it and all of rssticker.js if you feel that they would be helpful.

The feed I tried adding is http://ntcclibrary.wordpress.com/feed/

Thanks.

jr_yeo
08-09-2006, 05:42 PM
I did not make any changes to lastRSS.php but I can post the code for it and all of rssticker.js if you feel that they would be helpful.
its ok :p just thought to be thorough :cool: well, i guess u dont need to post the lastRSS.php and rssticker.js if u ddnt make any change with these two files :p

jr_yeo
08-09-2006, 06:20 PM
try:


//Relative URL syntax:
var lastrssbridgeurl="lastrss/bridge.php"

without the "../" :cool:
should work, i think. dont ask me why that works. i dunno either. i just tried removing it and the RSS Ticker works just fine. tnx. :p

ehartnett00
08-09-2006, 07:27 PM
Thanks for the suggestion. Suprisingly, I made the change in the code and nothing changed. The reason I originally added the ../ to the code is because the javascript file is in a subdirectory of the directory demo.htm is in so it has to drop back a directory before hitting the lastrss directory. Any other suggestions?

jr_yeo
08-09-2006, 08:50 PM
the change that i gave out works fine on my local webserver so i thought it might work for you too :p

Any other suggestions?
anyway, that's about it :cool:

Kirsh
08-17-2006, 08:43 AM
Yesterday while searching the not for a good lite rss ticker for my desktop, I found www.mightyticker.com/products.aspx

Look at the Excellent Features found on this piece of Amazing Software:

Mighty Ticker gives a new meaning to “Network News.” The system enables online, personalized news feeds from Web sites

selected and controlled by the user. Information from your news sources is discreetly scrolled on your PC Taskbar while you

work. For those of us who need streamlined news feeds, Mighty Ticker is the answer!

Mighty Ticker is an online, real-time ticker that scrolls customized information across your PC’s task bar at the bottom of

the screen. Whether the news source is Fox News, a stock broker site or eBay, Mighty Ticker captures and displays

streamlined data at the speed of the Net. Why is this beneficial? Because the tool carves out just the information you want

from a mountain of data availed by the Internet. Forget about specialized programming, additional fees, and trying to kluge

something together, Mighty Ticker does it for you! Even better, it’s quite simple to use and free!

Code:
Add Your Own Custom RSS or Atom Feeds
Mighty Ticker makes it easy to track your favorite RSS feeds and Auctions, by bringing the news and auctions that interest

you directly to your desktop as they are published.

* Add any feed covering virtually everything on the Web
* Search your favorite shopping sites - ebay, yahoo auctions, froggle, overstock
* Create your own eBay RSS search agents

Windows based for ease of use
Mighty Ticker can be used with any version of Windows.

* Autostart settings
* Auto or manual feed updates
* Auto software updates

Track your favorite auctions
Buyers are able to track their favorite auctions.

* User controls what auctions to watch
* Add custom auctions at any time
* Keeps you abreast to auction changes without annoying emails
* Get window alerts before auctions expire


Code:
http://www.mightyticker.com/downloads.aspx

chas
08-17-2006, 10:33 AM
not sure you can advertise your dirk tickler on here ;)