Fun with the Weather Underground API

Posted: September 27, 2013 in CC Lab
Tags: , ,

wunderground_api_fun

link to live example here

code on github here

For this assignment I used the Weather Underground’s API to create weather identifiers for some of my favorite cities. The API call grabs data for satellite imagery, current weather, wind, high, and low temperatures for the day. In my next iteration (unfinished) I’m looking to write the javascript code so that an object of areas and cities can be given rather than rewriting the $.ajax script 4 times.  For example an object called `geo` would have the following:

{
‘NY’ : ‘New_York’,
‘CA’ : ‘San_Francisco’,
‘MI’ : ‘Detroit’,
‘Germany’ : ‘Berlin’
}

and could be passed to a function that then generates data for all four locations, rather than hard-coding them. A further option could ask for a list of cities as user input and then generate the data.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s