Get Yahoo Weather with SimplePie
Wednesday, July 25th, 2007Posted in Web Development • Tags: SimplePie, weather, yahoo
SimplePie is a new PHP library made to make parsing RSS feeds easy and fun. Yes I said fun, because its very easy and the docs are well written. RSS is more than just news, it can be images, video and podcasts. Mash up the data however you want, I’ve seen some innovative and unique things done so far. They also offer sample code on making a site like popurls/Original Signal.
Figure I’d share some code I used with SimplePie and a Yahoo Weather RSS feed. I can’t post it all on the homepage as its really long. It does transform and output the data nicely (not any CSS styling but I do calculate the wind direction and some other things). Please note that Yahoo only permits you to use their Weather RSS feed on non-commercial sites.