Skip to content

Instantly share code, notes, and snippets.

@piuggi
Created March 8, 2015 23:28
Show Gist options
  • Save piuggi/b4ca3c8cfada194756f6 to your computer and use it in GitHub Desktop.
Save piuggi/b4ca3c8cfada194756f6 to your computer and use it in GitHub Desktop.
Get Location and Weather by Lat Long
var geocoderProvider = 'google';
var httpAdapter = 'http';
var geocoder = require('node-geocoder').getGeocoder(geocoderProvider, httpAdapter, {});
var weather = require('weather-js');
geocoder.reverse(40.7208628, -74.0455604, function(err, res) {
console.log(res);
weather.find({search: res[0].zipcode, degreeType: 'F'}, function(err, result) {
if(err) console.log(err);
console.log(JSON.stringify(result, null, 2));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment