web/res/js-tweetcast/connect-gevent.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Wed, 14 Dec 2011 12:46:53 +0100
changeset 410 bf5cf5a9e737
parent 406 86b62b98fea7
permissions -rw-r--r--
Merge with e4533dcbcedb987898b0da9f24f5279bc3455137

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