web/res/js-tweetcast/connect-gevent.js
author Raphael Velt <raph.velt@gmail.com>
Tue, 13 Dec 2011 19:01:59 +0100
changeset 406 86b62b98fea7
permissions -rw-r--r--
Polemic Tweet client now uses rv's live system

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