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

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