RSS feed parsing troubles

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Julien
Forum Newbie
Posts: 2
Joined: Tue Jan 20, 2009 7:26 am

RSS feed parsing troubles

Post by Julien »

Hi to all,

I am trying to parse an rss weather feed from the BBC like this one :

http://feeds.bbc.co.uk/weather/feeds/rs ... d/0008.xml

And the fact is that when i open the rss in the php using an fopen or even a @file(http://feeds.bbc.co.uk/weather/feeds/rs ... d/0008.xml) the result is different then what i can see if i open the source of the rss file and, more annoying, the one line telling the weather (sunny/cloudy/rainy...) is disappearing, i can't find it in my string. Do you know why this is happening, and how to deal with it ?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: RSS feed parsing troubles

Post by papa »

Julien
Forum Newbie
Posts: 2
Joined: Tue Jan 20, 2009 7:26 am

Re: RSS feed parsing troubles

Post by Julien »

Thank you, indeed, seems better.
Now a last question on the topic. How can i get my object(SimpleXMLElement)#x ?
I see there seem to be an id numerotation, which is very helpful but i can't see a function allowing me to get one of the objects easily. Am i blind ? :D
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: RSS feed parsing troubles

Post by pickle »

Unless you're dead set on parsing the feed with code you've written yourself, I'd look at SimplePie
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply