Jump to content

Parsing Yahoo XML Weather feed


benn600

Recommended Posts

I've spent a lot of time trying to find an appropriate XML parser for PHP that I can get to work as I need.  The developer info is here:

http://developer.yahoo.com/weather/

and the feed is here:

http://weather.yahooapis.com/forecastrss?p=52402

 

The main piece I want to extract is:

<yweather:condition text="Mostly Cloudy" code="26" temp="57" date="Tue, 29 Nov 2005 3:56 pm PST"></yweather:condition>

 

-- specifically, the code="26" piece.  With this code, I can read from the array of codes and print the condition--and also print an image with the info.  I was using SimpleXML but it does not include the "yweather:" branches or the internal attributes.  How do I access these?  I'd like to add this weather to my personal homepage site.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/146068-parsing-yahoo-xml-weather-feed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.