
Meteor.methods({
  fetchTwitterApi: function(){
    var tweetDebounce = _.debounce(Meteor.bindEnvironment(function(){
      var Twit = Meteor.npmRequire('twit');
      T = new Twit({
        consumer_key: Meteor.settings.twitter.consumer_key,
        consumer_secret: Meteor.settings.twitter.consumer_secret,
        access_token: Meteor.settings.twitter.access_token,
        access_token_secret: Meteor.settings.twitter.access_token_secret
      })
      T.get('search/tweets', { q: 'from:RasmusHjulskov #webonaut', count: 100 }, Meteor.bindEnvironment(function(err, data, response) {
         if(!err){
          data.statuses.forEach(function(entry) {
            console.log(entry)
            entry.unixTime = moment(entry.created_at).unix();
            Meteor.call('addTweet', entry);
          });
         }
      }));
    }, 60 * 1000));

    tweetDebounce();
  }
});

@@ -589,17 +589,16 @@
         
- 
 if(!err)
@@ -609,16 +609,19 @@
         
+if(
 data.sta
@@ -630,65 +630,76 @@
 ses.
-forEach(function(entry) %7B%0A            console.log
+length != 0)%7B%0A            data.statuses.forEach(function
 (entry)
-%0A
+ %7B%0A  
     
@@ -768,16 +768,18 @@
         
+  
 Meteor.c
@@ -816,13 +816,26 @@
     
+  
 %7D);%0A 
+         %7D%0A
     

twitFeed if empty