In response to observed, unexpected behavior, I made a minor tweak to our PHP script that does the RSS to JS magic, using JavaScript to embed RSS content in any page.

The probllem was on the simple way I was naming my cache files (the RSS parser I use creates cache files to ease the load on your server)- previously it based the cache file on just the path and file name of the RSS feed, so in some cases people were getting feeds from other sites (bad).

Now cache files are based on the entire URL, as to make them unique. The change would not likely affect someone running our PHP script to generate feeds from their own sites- it is more of a problem like ours, where when I cleaned the cache directory, I saw nearly 500 cache files.

Your mileage may vary.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

  1. Hello,

    Nice script. It works beautifully. However, i’m using RSSv2.0 and im having problems adjusting the code from $dc_date to use . Is there any chance you can improve compatibility issues? At the moment its not parsing the date correctly and showing 1970 as the date.

    Thank you, keep up the great work.

  2. Alan, I was emailing this link to a fella and noticed the update. Thanks!

    We need an email list to be notifed of updates! 🙂

    You’ve created a monster!

    Thanks again

    Richard

  3. Alan, back again, updated scripts work great,

    FYI:

    “rss2js.php script” has been updated but the “Version History” hadn’t … confusing

    Also, as to the date comment above, I’m using V2.0 also and the justed tested, the date comes thru fine. I wonder if his feed validates?

    Thanks again

    Peace

    Richard

  4. “Alien” was correct, my code was not properly handling the RSS 2.0 feeds, but I just posted a fix:

    http://jade.mcli.dist.maricopa.edu/alan/archives/000241.html

    or test it at:

    http://jade.mcli.dist.maricopa.edu/feed/

    The problem was the code looking at itme tags was not lookign for pubDate (now it does)- and as I discovered, it would not get the URLs linked because it was not looking for the <guid> tags.

    Richard,

    I have seen a few MovableType feeds billed as RSS 2.0 but they actually are not using pubDate.

  5. Pingback: cogdogblog

Comments are closed.