Skip to content

Instantly share code, notes, and snippets.

View saumyasuhagiya's full-sized avatar
🎯
Focusing

Saumya Suhagiya saumyasuhagiya

🎯
Focusing
View GitHub Profile
@Abuwabu
Abuwabu / locations.js
Last active May 3, 2016 12:18
Request ip from ipinfo.io If no city, determine from google via Lat&Lon
var request = require('request'),
url = 'http://ipinfo.io',
google = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='
module.exports = function () {
return new Promise(function (resolve, reject) {
request({
url: url,
json: true