Add tweeter feed. 3 last posts

why the need for setInterval? poller() is executed immediately

On Sat, Oct 4, 2014 at 8:03 AM, Sergio Crisostomo <notifications@github.com>
wrote:

> In middleware/twitter.js:
>
> > +
> > +var keys = require('./../config/api_keys.json').twitter;
> > +var twitter = require('twitter');
> > +var twit = new twitter(keys);
> > +
> > +module.exports = function(interval){
> > +
> > +	var tweets;
> > +	var timer;
> > +
> > +	// interval updating the data happens
> > +	if (!interval) interval = 1000 * 60 * 30; // each 30 minutes
> > +
> > +	// periodically fetching the Twiter API.
> > +	var poller = function(){
> > +		twit.get('/statuses/user_timeline.json', {include_entities:true, screen_name: 'mootools'}, function(data) {
>
> twit.get() returns nothing. Its a async function that updates the tweets
> variable passed into res.locals.twitter
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mootools/website/pull/91/files#r18429091>.
>