-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added README.md to SmartTV platform folder.
- Loading branch information
Showing
4 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
javascript.iml | ||
*.js-e | ||
upload/* | ||
.idea | ||
*.iml |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
var assert = require('assert'); | ||
var PUBNUB = require('../pubnub.js'); | ||
|
||
var pubnub = PUBNUB.init({ | ||
publish_key : 'demo', | ||
subscribe_key : 'demo' | ||
}); | ||
|
||
var channel = 'javascript-test-channel'; | ||
var count = 0; | ||
|
||
var message_string = 'Hi from Javascript'; | ||
|
||
describe('Pubnub', function() { | ||
this.timeout(40000); | ||
describe('#publish()', function(){ | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
it('should publish json arrays without error 1', function(done){ | ||
pubnub.publish({channel: channel , message : message_string, | ||
callback : function(response) { | ||
done() | ||
} | ||
}); | ||
|
||
}) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# SmartTV JavaScript SDK for Sony, Philips, LG, Samsung and more! | ||
|
||
## PubNub JavaScript SDK Usage | ||
|
||
You may access the latest PubNub JavaScript SDK on The PubNub Network CDN. | ||
|
||
```html | ||
<script src=pubnub.min.js ></script> | ||
<script>(function(){ | ||
var pubnub = PUBNUB.init({ | ||
publish_key : 'demo', | ||
subscribe_key : 'demo' | ||
}); | ||
})();</script> | ||
``` | ||
|
||
## SIMPLE EXAMPLE | ||
|
||
>**NOTE:** Copy and paste this example into a *blank* HTML file. | ||
```html | ||
<div id=pubnub pub-key=demo sub-key=demo></div> | ||
<script src=http://cdn.pubnub.com/pubnub-3.4.8.min.js ></script> | ||
<script> | ||
// LISTEN | ||
PUBNUB.subscribe({ | ||
channel : "hello_world", | ||
message : function(m){ alert(m) }, | ||
connect : publish | ||
}) | ||
// SEND | ||
function publish() { | ||
PUBNUB.publish({ | ||
channel : "hello_world", | ||
message : "Hi." | ||
}) | ||
} | ||
</script> | ||
``` | ||
|