RSS to JS update

Alan Levine aka CogDog barked this May 13th, 2003 11:26 am

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 ;-)

Technorati Tags:

This entry was posted 5 years, 6 months ago and is filed under Blog Pile. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

6 Responses to “RSS to JS update”

  1. cogdogblog Says:

    RSS 2 JS Code and Demo LAST update

    Okay, this should do it for a while. suggested adding an output option to allow insertion of item date to the list. While in the code, I also made it possible to have an option on the channel display to…

  2. Rob Ainbinder Says:

    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

  3. Alan Levine Says:

    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.

  4. Rob Ainbinder Says:

    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.

  5. Rob Ainbinder Says:

    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.

  6. Alan Says:

    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


Creative Commons License
This work is licensed under a Creative Commons Attribution 2.5 License
and may be patrolled by a friendly small dog (with a wagging tail)
This means you are free to use any original content published here (begs the question why)
as long as you provide linktribution.

.
Clicky Web Analytics