Web Analytics Made Easy -
StatCounter PHP Parser of RSS Feed - CodingForum


No announcement yet.

PHP Parser of RSS Feed

  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP Parser of RSS Feed

    Hi, everybody.

    After many years of having an RSS feed successfully displayed on a website, it recently stopped working.

    It looks like the company that was supplying the feed changed the URL.

    Previously, the feed address was:

    The new feed, from their website, is:

    The code snippet for the RSS parser, written in PHP, follows:

    $file = "https://www.sciencedaily.com/rss/space_time/space_exploration.xml";
    . . .
    if (!($fp = fopen($file, "r"))) {
        die("could not open XML input");
    The die action always happens, indicating that the XML file could not be opened.

    Any idea what the problem is?

    Is it the XML, or the PHP code?
    Last edited by DavidB; Sep 18, 2023, 02:40 PM.

  • #2
    Hi there DavidB,
    I get this warning for your code...

    failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
    If I put the actual link in the address bar then Firefox downloads
    rather than displays the file.

    ~ the original bald headed old fart ~


    • #3
      Hi there DavidB,

      as a matter of interest Google Chrome displays the xml code
      and Vivaldi actually renders the page

      .Click image for larger version

Name:	www.sciencedaily.com.png
Views:	15
Size:	73.6 KB
ID:	2436969

      ~ the original bald headed old fart ~


      • #4
        Do you know how to fix the problem? Previously, the PHP parser took in the feed, displayed the top twenty headlines, with hot-links, so people could go to the story that interested them. Now, apparently, it can't even open the file. What happened? And how do I get it to work properly again?


        • #5
          Hi there DavdB,

          both Firefox and Google Chrome have removed built-in support
          for web feeds, Firefox in 2018 and Google Chrome in 2021..

          All I can suggest is that you do a search for feed readers..

          ~ the original bald headed old fart ~


          • #6
            Thank you for creating this thread. I was searching for a similar topic for a while. Thanks again.