This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getZipCode(location, callback) { | |
//If it's a woeid, we bypass the first step | |
if ($.isNumeric(location)) { | |
woeid_request(location, callback) | |
//If they use a normal location | |
} else { | |
$.get("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22" + encodeURIComponent(location) + "%22&format=xml", function(locationData) { | |
// Gets the WOEID && Caches Location Name | |
var woeid = $(locationData).children().children().children().first().children().filterNode("woeid").text() | |
localStorage.typhoon_location = $(locationData).children().children().children().first().children().filterNode("name").text() |
NewerOlder