tweetcast/client/js/connect-gevent.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Thu, 15 Dec 2011 18:42:18 +0100
changeset 416 49ff61b8baf6
parent 404 89968844eb7d
permissions -rw-r--r--
Merge with c0e892c26894c380c352f6f0cc11ac2a9a1d6e6e

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