Skip to content

Instantly share code, notes, and snippets.

@kossnocorp
Created February 3, 2015 14:02
Show Gist options
  • Save kossnocorp/8b020cac2805b18d1531 to your computer and use it in GitHub Desktop.
Save kossnocorp/8b020cac2805b18d1531 to your computer and use it in GitHub Desktop.
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