tweetcast/client/js/connect-nodejs.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

document.write('<script type="text/javascript" src="/socket.io/socket.io.js"><' + '/script>');

function connectTweets() {
    socket = io.connect('http://' + document.location.host );
    
    socket.on("initial_data", function(data) {
        loadTweets(data.tweets)
    });
    
    socket.on("update", function(data) {
        if (!twCx.tweets) {
            return;
        }
        loadTweets(data.new_tweets, true);
    });
}