Skip to content

Instantly share code, notes, and snippets.

@stephenlb
Forked from dristic/main.js
Last active December 21, 2015 22:09
Show Gist options
  • Save stephenlb/6373429 to your computer and use it in GitHub Desktop.
Save stephenlb/6373429 to your computer and use it in GitHub Desktop.
var pubnub = PUBNUB.init({
publish_key : '<PUBLISH_KEY>',
subscribe_key : '<SUBSCRIBE_KEY>'
})
pubnub.subscribe({
channel : "my_channel",
message : function (message) {
console.log("I got the message: " + message)
},
connect : function () {
pubnub.publish({
channel : "my_channel",
message : "Hello World!"
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment