File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ /* ---------------------------------------------------------------------------
2+
3+ Init PubNub and Get your PubNub API Keys:
4+ http://www.pubnub.com/account#api-keys
5+
6+ --------------------------------------------------------------------------- */
7+
8+ function logResults ( r ) {
9+ console . log ( "RESULT from " + r . operation + " call:" ) ;
10+ console . log ( JSON . stringify ( r , null , 2 ) ) ;
11+ }
12+
13+ function logStatus ( r ) {
14+ console . log ( "STATUS from " + r . operation + " call:" ) ;
15+ console . log ( JSON . stringify ( r , null , 2 ) ) ;
16+ }
17+
18+ var pubnub = require ( "./../pubnub.js" ) . init ( {
19+ publish_key : "demo-36" ,
20+ subscribe_key : "demo-36" ,
21+ secret_key : "demo-36" ,
22+ ssl : true ,
23+ uuid : "v4_migration" ,
24+ result : logResults ,
25+ status : logStatus
26+ } ) ;
27+
28+ var channel = "a" ;
29+ var message = "Hello World !!!"
30+
31+ pubnub . subscribe ( {
32+ channel : channel }
33+ ) ;
34+
35+ pubnub . history ( {
36+ channel : channel
37+ } ) ;
38+
39+ pubnub . publish ( {
40+ channel : channel ,
41+ message : message
42+ } ) ;
43+
44+ pubnub . grant ( {
45+ channel : channel ,
46+ read : true ,
47+ write : true
48+ } ) ;
49+
50+ pubnub . audit ( {
51+ channel : channel
52+ } ) ;
You can’t perform that action at this time.
0 commit comments