diff -r dd1686ae5506 -r 89968844eb7d tweetcast/client/js/connect-gevent.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/js/connect-gevent.js Mon Dec 12 12:54:14 2011 +0100 @@ -0,0 +1,14 @@ +function connectTweets() { + $.getJSON('http://' + document.location.hostname + ':8888/?callback=?', function(data) { + loadTweets(data.tweets) + } ); + + setInterval(function() { + if (!twCx.tweets) { + return; + } + $.getJSON('http://' + document.location.hostname + ':8888/?after_id=' + twCx.tweets[twCx.tweets.length - 1].id + '&callback=?', function(data) { + loadTweets(data.tweets, true); + }); + }, 1000) +} \ No newline at end of file