tweetcast/client/js/connect-gevent.js
author Raphael Velt <raph.velt@gmail.com>
Fri, 10 Feb 2012 16:32:13 +0100
changeset 496 e307f08f59c5
parent 404 89968844eb7d
permissions -rw-r--r--
Added tag V01.30 for changeset 7453030fd06f

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