From b8d1dd86a0d8c4261d4f3765f3ca227d7b555c84 Mon Sep 17 00:00:00 2001 From: Devendra Date: Tue, 25 Mar 2014 10:50:39 +0530 Subject: fixing encryption, and changing from urllib3 to urllib --- python/examples/publish-example.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'python/examples') 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) -- cgit v1.2.3