aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples
diff options
context:
space:
mode:
authorDevendra2014-03-25 10:50:39 +0530
committerDevendra2014-03-25 10:50:39 +0530
commitb8d1dd86a0d8c4261d4f3765f3ca227d7b555c84 (patch)
treed5cd2e092f44ff36e739fd029afc7b028c8c087f /python/examples
parent80edcffbfe140a6d19c65deca24e1ba1c0f49b99 (diff)
downloadpubnub-python-b8d1dd86a0d8c4261d4f3765f3ca227d7b555c84.tar.bz2
fixing encryption, and changing from urllib3 to urllib
Diffstat (limited to 'python/examples')
-rwxr-xr-xpython/examples/publish-example.py32
1 files changed, 29 insertions, 3 deletions
diff --git a/python/examples/publish-example.py b/python/examples/publish-example.py
index 55f19ea..31ae198 100755
--- a/python/examples/publish-example.py
+++ b/python/examples/publish-example.py
@@ -4,14 +4,40 @@ sys.path.append('..')
from Pubnub import Pubnub
## Initiate Class
-pubnub = Pubnub( publish_key='demo', subscribe_key='demo', ssl_on=False )
+pubnub = Pubnub( publish_key='demo', subscribe_key='demo', cipher_key='enigma', ssl_on=False )
+#pubnub = Pubnub( publish_key='demo', subscribe_key='demo', ssl_on=False )
## Publish Example
info = pubnub.publish({
- 'channel' : 'hello_world',
+ 'channel' : 'abcd',
'message' : {
- 'some_text' : 'Hello my World'
+ 'iam' : 'object'
}
})
print(info)
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : "hi I am string"
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : 1234
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : "1234"
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : [
+ 'i' , 'am', 'array'
+ ]
+})
+print(info)