CDB cat dog-egories:
      

May 13, 2003

RSS to JS update

A quick update to the PHP script for the RSS to Javascript demo posted here May 7.

For a reminder, this is a strategy for incorporating RSS feeds into ANY web page (HTML, Blackboard, WebCT) via a reference to a single line of JavaScript code.

The mian improvements (suggested by Randy Brown) were to add URL parameter options:

  • to show/hide channel information
  • set a number of items to display
  • show/hide the item descriptions

I also changed the way the script accesses the variables to the $_GET array as some servers that have PHP security settings for globals=off may run into some trouble (this was a first attempt at addressing this issue; and I am not sure it takes care of the problem- see I am a hack programmer ;-)

blogged May 13, 2003 11:26 AM :: category [ rss ] :: TrackBack
Comments

I appreciate everyone's efforts on this project. Now I have the enviable task of putting to use all of your work.

But,alas, the enivitable baffling techno glitch.
Can anyone help? I've installed but, no feed displayed when pointing to the script on our server. Now, when I point to the script on your server it's fine.

Test page http://www.nczoo.org/scripts/rss/

Rob

Posted by: Rob Ainbinder at June 6, 2003 08:21 AM

Sorry if is not as smooth as I lef you to believe.

First of all, the syntax of your JavaScript is not correct you must have the src= followinf the question mark

You have:

src=http://www.nczoo.org/scripts/rss/rss2js.php?http://theregister.co.uk/feeds/latest.rdf

and it should be:
src=http://www.nczoo.org/scripts/rss/rss2js.php?src=http://theregister.co.uk/feeds/latest.rdf

When doing the testing, you should start be just testing the url in your browser. e.g. paste in:

http://www.nczoo.org/scripts/rss/rss2js.php?src=http://theregister.co.uk/feeds/latest.rdf

Sometihng is not correct about your script or set up but I have no way (or time) to diagnose. As you noted, the feed works fine on ours:

http://jade.mcli.dist.maricopa.edu/feed/rss2js.php?src=http://theregister.co.uk/feeds/latest.rdf

Make sure you have correct settings for the paths to the Onyx library amd your cache location.

Posted by: Alan Levine at June 6, 2003 03:29 PM

Alan-

Thanks for the pointers. I did as you suggested and I'm now able to see the error condition by opening the feed from my browser, downloading and reviewing it.

The error is:
"Could not open the specified file. Check the path, and make sure that you have write permissions to this file."

I am checking with our webhost on write permissions as I am certain I now have the correct path.

Posted by: Rob Ainbinder at June 9, 2003 07:41 AM

In your download package I would suggest editing line #87 of the rss2js.php to point correctly to the onyx function as it is unzipped.

I know it's pretty basic but, this may save some PHP newbies (like me) some pain.

Thanks again.

Posted by: Rob Ainbinder at June 9, 2003 07:48 AM

Thanks Rob, I had forgotten to remove the paths I use on my server, and needed to uncomment the default ones for the download package. It is corrected now in the download ZIP

Posted by: Alan at June 16, 2003 07:32 AM
Spammers Have Force Our Hands...
spamroach.jpg
Note: Those nasty blog-spamming roaches have forced us to take action to prevent their spread- all entries made to this nlog will remain open only for 30 days within their original posting date.

If you really need to make contact with the chief dog around here, please submit a request via our feedback center