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 😉
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
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.
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.
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.
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