A very simple means of extracting weather information for inclusion in your website is via a very unknown Google weather API. The API will return weather in a very digestible XML format that you can easily parse for inclusion on any page.
The API requires no key and is seemingly unsupported, so it should be used with caution, and the expectation that it’ll stop working without notice.
A Sample Application for Sydney, Australia
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=Sydney,Australia');
$information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");
Note that I’ve simply replaced
ADDRESS with a city and state (although you can use local data as well). You can also replace with a US zip code. The API will return data that looks like this.
icon data returned points to image files used by the iGoogle front page (and word has it that iGoogle is going the way of the iDodo).
Other Secret API’s
I shouldn’t use the word “secret” – but they are very much an unknown. Google has a bunch of API’s accessible without a key or any kind of registration; and they return funky data that you can easily incorporate into your website or application.
Given that they’re not widely publicised by Google (and somebody please correct me if I’m wrong), they seemingly come without support, warranty or any kind of guarantee. There’s no mention of them on the Google website
Google’s Stock API
http://www.google.com/ig/api?stock=VBA will return the latest stock information for Virgin Blue Airlines. http://www.google.com/ig/api?stock=GOOG will return the latest data for Google. Data is returned in an XML format that can be easily fashioned for inclusion on your website.
Other Google API’s
Google already returns its news via a digestible RSS feed, but the News API returns it in a more usable format (http://www.google.com/ig/api?news). There seems to be an API for movies although I haven’t quite figured it out (http://www.google.com/ig/api?movies=90210).
Shortt URL for this post: