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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.