Created
December 22, 2013 19:38
-
-
Save ricomoss/8087336 to your computer and use it in GitHub Desktop.
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
Feeds = new Meteor.Collection('feeds'); | |
if (Meteor.isServer) { | |
var twitter_user_id = 0; | |
var boundCallback = Meteor.bindEnvironment(function (err, resp) { | |
var play = true; | |
return play; | |
}); | |
Meteor.methods({ | |
twit_get: function() { | |
Twit = new TwitMaker({ | |
consumer_key: 'foo', | |
consumer_secret: 'foo', | |
access_token: 'foo', | |
access_token_secret: 'foo' | |
}); | |
Twit.get( | |
'search/tweets', | |
{ | |
q: '#nfl since_id:' + twitter_user_id, | |
count: 5 | |
}, | |
// I need to capture the return of the boundCallback here | |
boundCallback | |
); | |
return play; | |
} | |
}); | |
} | |
if (Meteor.isClient) { | |
Template.twitter_feeds.feeds = function () { | |
return Feeds.find({}, {sort: {created_at: -1}}); | |
}; | |
Meteor.setInterval(function () { | |
var play = Meteor.call('twit_get'); | |
console.log(play); | |
}, 5000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment