forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget.js
More file actions
29 lines (19 loc) · 869 Bytes
/
Copy pathget.js
File metadata and controls
29 lines (19 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ---------------------------------------------------------------------------
Init PubNub and Get your PubNub API Keys:
http://www.pubnub.com/account#api-keys
--------------------------------------------------------------------------- */
var PUBNUB = require("../../pubnub.js")
var pubnub = PUBNUB({
write_key : "pub-c-bf446f9e-dd7f-43fe-8736-d6e5dce3fe67",
read_key : "sub-c-d1c2cc5a-1102-11e4-8880-02ee2ddab7fe",
origin : "dara25.devbuild.pubnub.com"
});
function log2(r) {
console.log(JSON.stringify(r.value(), null, 2));
}
function log(r) {
console.log(JSON.stringify(r));
}
pubnub.snapshot({"object_id":"home", "path":"occupants", "callback":log2, "error":log2});
pubnub.snapshot({"object_id":"home.occupants", "callback":log2, "error":log2});
pubnub.snapshot({"object_id":"home", "callback":log2, "error":log2});