tweetcast/client/js/connect-gevent.js
author Raphael Velt <raph.velt@gmail.com>
Mon, 12 Dec 2011 12:54:14 +0100
changeset 404 89968844eb7d
permissions -rw-r--r--
Tweetcast: heavy refactoring !

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)
}