weather-api
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -5,3 +5,3 @@ { | ||
"description": "Low level API abstractions for weather services.", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"homepage": "https://github.com/justjohn/weather-api", | ||
@@ -8,0 +8,0 @@ "licenses": [ |
@@ -15,34 +15,2 @@ var API = require('common-api').API, | ||
WeatherUnderground.prototype.call2 = function(path) { | ||
var deferred = Q.defer(); | ||
var options = { | ||
host: 'api.wunderground.com', | ||
port: 80, | ||
path: '/api/' + this.api_key + path, | ||
method: 'GET' | ||
}; | ||
var req = http.request(options, function(res) { | ||
var output = ''; | ||
res.setEncoding('utf8'); | ||
res.on('data', function (chunk) { | ||
output += chunk; | ||
}); | ||
res.on('end', function () { | ||
var json = JSON.parse(output); | ||
deferred.resolve(json); | ||
}); | ||
}); | ||
req.on('error', function(e) { | ||
deferred.reject('problem with request: ' + e.message); | ||
}); | ||
req.end(); | ||
return deferred.promise; | ||
}; | ||
WeatherUnderground.prototype.geoforecast = function() { | ||
@@ -49,0 +17,0 @@ var deferred = Q.defer(); |
3997
111