Created
February 3, 2015 14:02
-
-
Save kossnocorp/8b020cac2805b18d1531 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var csp = require('js-csp'); | |
var Github = require('./github'); | |
var GoogleMaps = require('./google_maps'); | |
var TEAM = process.env.GITHUB_TEAM; | |
csp.go(function*() { | |
var team = yield csp.take(Github.getTeamMembers(TEAM)); | |
for (var i = 0; i < team.length; i++) { | |
let member = yield csp.take(Github.getMember(team[i]['login'])); | |
let locationResp = yield csp.take(GoogleMaps.getLocation(member['location'])); | |
let location = locationResp['results'][0]; | |
console.log(`> ${member.name}`); | |
if (location) { | |
console.log(` ${location['formatted_address']} (${location['geometry']['location']['lat']}-${location['geometry']['location']['lng']})`); | |
} else { | |
console.log(` Location not found`); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment