Last active
January 1, 2016 02:29
-
-
Save brianherbert/8079489 to your computer and use it in GitHub Desktop.
Parse through Twit reposes in Meteor
This file contains 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 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