NodeKO: Nodenockout 2011

PubNub is free for you as a NodeKO App Developer. Following this Simple Start Web Guide. Connect mobile phones, tablets, web browsers and more with a 2 Function Publish/Subscribe API (send/receive). To learn more about PubNub and how PubNub works, read How It Works.

NodeKO WIN: iPad 2s.

NodeKO PubNub Step 1

If you are building HTML5 Web Apps, start by copying and pasting the code snippet below. If not, skip to Step 2.

<div pub-key="demo" sub-key="demo" id="pubnub"></div>
<script src="http://cdn.pubnub.com/pubnub-3.1.min.js"></script>
<script>(function(){

    // Listen For Events
    PUBNUB.subscribe({
        channel  : "hello_world",      // Channel
        error    : function() {        // Lost Connection (auto reconnects)
            alert("Connection Lost. Will auto-reconnect when Online.")
        },
        callback : function(message) { // Received An Event.
            alert(message.anything)
        },
        connect  : function() {        // Connection Established.

            // Send Message
            PUBNUB.publish({
                channel : "hello_world",
                message : { anything : "Hi from PubNub." }
            })

        }
    })

})();</script>

NodeKO PubNub Step 2

PubNub GitHub APIs connect programming languages: NodeJS, Ruby, PHP, Python, Perl, Erlang and more programming languages on GitHub.