Skip to content

Instantly share code, notes, and snippets.

@ricomoss
Created December 22, 2013 19:38
Show Gist options
  • Save ricomoss/8087336 to your computer and use it in GitHub Desktop.
Save ricomoss/8087336 to your computer and use it in GitHub Desktop.
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