Skip to content

Instantly share code, notes, and snippets.

@amyleew
Created April 2, 2014 21:16
Show Gist options
  • Save amyleew/9943367 to your computer and use it in GitHub Desktop.
Save amyleew/9943367 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="content">
</div>
</body>
</html>
var req = $.when($.ajax({
url: 'http://api.wunderground.com/api/419ec08f527a6f9b/geolookup/q/pws:KCASANFR58.json',
dataType: 'jsonp',
type: "GET"
}), $.ajax({
url: 'http://api.wunderground.com/api/419ec08f527a6f9b/geolookup/q/pws:KCASANFR142.json',
dataType: 'jsonp',
type: "GET"
}), $.ajax({
url: 'http://api.wunderground.com/api/419ec08f527a6f9b/geolookup/q/pws:KCASANFR128.json',
dataType: 'jsonp',
type: "GET"
}), $.ajax({
url: 'http://api.wunderground.com/api/419ec08f527a6f9b/geolookup/q/pws:KCASANFR34.json',
dataType: 'jsonp',
type: "GET"
}), $.ajax({
url: 'http://api.wunderground.com/api/419ec08f527a6f9b/geolookup/q/pws:KCASANFR111.json',
dataType: 'jsonp',
type: "GET"
})).done(function(r1, r2, r3, r4, r5) {
console.log(r1, r2, r3, r4, r5);
});
req.done(displayEntries);
function displayEntries(data) {
var stations = data.location.nearby_weather_stations.pws.station;
console.log(data);
console.log(stations);
for (var i=0; i < stations.length; i++) {
var station = stations[i];
console.log(station.neighborhood);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment