Question

I'm trying to parse this feed http://www.bbc.co.uk/sport/football/teams/newcastle-united/rss.xml I get this message "A feed could not be found at http://. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed." If I use force_feed I get an error "This XML document is invalid, likely due to invalid characters. XML error: Mismatched tag at line 27, column 8" but looking at the xml I can't see any errors. Indeed, checking at http://validator.w3.org/ seems to validate fine. Any suggestions? I'm running the latest version of simplepie downloaded a few days ago.

Was it helpful?

Solution

I found the problem when I stripped out the code to create a test case. The url being loaded was http://www.bbc.co.uk//sport/football/teams/newcastle-united/rss.xml (notice the double forward slash). simplepie seems to not be dealing with this gracefully. Removing the double slash fixes the problem

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top