Created
December 22, 2013 07:53
-
-
Save ricomoss/8079546 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) { | |
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: 'banana since:2013-12-11', | |
count: 10 | |
}, | |
function(err, reply) { | |
for (var obj in reply['statuses']) { | |
Feeds.insert({feed: reply['statuses'][obj].text}); | |
} | |
}); | |
} | |
}); | |
} | |
if (Meteor.isClient) { | |
Template.twitter_feeds.feeds = function () { | |
return Feeds.find({}, {sort: {feed: -1}}); | |
}; | |
Meteor.call('twit_get'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment