diff options
Diffstat (limited to 'python/examples/publish-example.py')
| -rwxr-xr-x | python/examples/publish-example.py | 32 | 
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) | 
