PHP RSS data extraction
Posted: Thu Aug 02, 2007 7:27 am
Hi guys,
I'm parsing an RSS feed from The Weather Network at the moment using SimpleXML (which is aweeesome!) in PHP.
Here's the code I have at the moment...
...which outputs...
This is fine and great and cool and allsorts, but all I really want is:
Does anyone know if there's an easier way of extracting this data, or a Weather feed which is easier to chop up?
Thank youuuuuu.
I'm parsing an RSS feed from The Weather Network at the moment using SimpleXML (which is aweeesome!) in PHP.
Here's the code I have at the moment...
Code: Select all
$xml = simplexml_load_file('http://rss.theweathernetwork.com/weather/gbxx0005');
$dc = $xml->children();
echo $dc->channel->title;
echo "<br/><br/>";
echo $dc->channel->item->description;Code: Select all
The Weather Network - Sheffield, United Kingdom
Partly cloudy, 17 °C(62 °F) , Humidity 63% , Wind W 11km/h- Region i.e. Sheffield, United Kingdom
- Temperature i.e. 17 degrees
- And the conditions so I can reference an image I've created OR a URL for an image created by the feed
Does anyone know if there's an easier way of extracting this data, or a Weather feed which is easier to chop up?
Thank youuuuuu.