tweetcast/client/js/connect-gevent.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Tue, 14 Feb 2012 14:35:09 +0100
changeset 516 819a9cd7679c
parent 404 89968844eb7d
permissions -rw-r--r--
Added tag V01.38 for changeset 6dac95a86a52

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