Skip to content

Instantly share code, notes, and snippets.

@brianherbert
Last active January 1, 2016 02:29
Show Gist options
  • Save brianherbert/8079489 to your computer and use it in GitHub Desktop.
Save brianherbert/8079489 to your computer and use it in GitHub Desktop.
Parse through Twit reposes in Meteor
var fut = new Future();
var screen_name = Meteor.user().profile.twitterHandle;
Twit.get('statuses/user_timeline', { screen_name: screen_name, include_rts: false, count: 200 }, function(err, tweets) {
var i;
for (i = 0; i < tweets.length; ++i) {
if(tweets[i].geo != null) {
var geo = {lat: tweets[i].geo.coordinates[0], lon: tweets[i].geo.coordinates[1]};
fut['return'](geo);
return;
}
}
});
return fut.wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment