This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div | |
channel-name=notifications-channel | |
segregate-notifications-by-page=false | |
id=desktop-notifications-config | |
></div> | |
<div id=pubnub pub-key=demo sub-key=demo></div> | |
<script src=http://http://cdn.pubnub.com/pubnub-3.5.4.min.js></script> | |
<script | |
src=http://www.pubnub.com/static/html5-desktop-notification-broadcasting.js | |
></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
piAId='29622'; | |
piCId='23596'; | |
(function(){ | |
function async_load(){ | |
var s=document.createElement('script');s.type='text/javascript'; | |
s.src=('https:'==document.location.protocol?'https://pi':'http://cdn') | |
+'.pardot.com/pd.js'; | |
var c=document.getElementsByTagName('script')[0]; | |
c.parentNode.insertBefore(s,c);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
/* | |
// ----------------------------- // | |
// -- MTGOX TICKER DISPLAY -- // | |
// ----------------------------- // | |
PUBNUB.events.bind( 'trade.BTC', function(data) { console.log(data); } ); | |
// ----------------------------- // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://cdn.pubnub.com/pubnub.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script> | |
<script src="http://pubnub.github.io/angular-js/scripts/pubnub-angular.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enter Chat and press enter | |
<div><input id=input placeholder=you-chat-here /></div> | |
Chat Output | |
<div id=box></div> | |
<script src=http://cdn.pubnub.com/pubnub.min.js></script> | |
<script>(function(){ | |
var pubnub = PUBNUB.init({publish_key:'demo',subscribe_key:'demo',ssl:true}); | |
var box = PUBNUB.$('box'), input = PUBNUB.$('input'), channel = 'chat'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUBNUB.subscribe({ | |
channel : "hello_world", | |
message : function( message, envelope, channel ) { | |
// TIMETOKEN | |
console.log(envelope[1]); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pam | |
## PubNub Access Manager (PAM) | |
manager = pam.access( | |
pubkey="pam", | |
subkey="pam", | |
seckey="pam" | |
) | |
## Grant User Access |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
// Calculating a PubNub Message Payload Size. | |
function calculate_payload_size( channel, message ) { | |
return encodeURIComponent( channel + JSON.stringify(message) ).length + 97; | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ticker.LTCGBP": "0102a446-e4d4-4082-8e83-cc02822f9172", | |
"ticker.LTCCNY": "0290378c-e3d7-4836-8cb1-2bfae20cc492", | |
"depth.BTCHKD": "049f65dc-3af3-4ffd-85a5-aac102b2a579", | |
"depth.BTCEUR": "057bdc6b-9f9c-44e4-bc1a-363e4443ce87", | |
"ticker.NMCAUD": "08c65460-cbd9-492e-8473-8507dfa66ae6", | |
"ticker.BTCEUR": "0bb6da8b-f6c6-4ecf-8f0d-a544ad948c15", | |
"depth.BTCKRW": "0c84bda7-e613-4b19-ae2a-6d26412c9f70", | |
"depth.BTCCNY": "0d1ecad8-e20f-459e-8bed-0bdcf927820f", | |
"ticker.BTCCAD": "10720792-084d-45ba-92e3-cf44d9477775", |