diff options
| author | Devendra | 2014-06-17 03:37:51 +0530 | 
|---|---|---|
| committer | Devendra | 2014-06-17 03:37:51 +0530 | 
| commit | 0c90b0ce532d01e3a2232a8416362923bb76f3f5 (patch) | |
| tree | 98a62b3d41b436713d55debaea0260f6270390ae | |
| parent | 6363edd8797f914af23612bd576462dcceb408f2 (diff) | |
| download | pubnub-python-0c90b0ce532d01e3a2232a8416362923bb76f3f5.tar.bz2 | |
readme change
| -rw-r--r-- | python-twisted/README.md | 29 | ||||
| -rw-r--r-- | python/README.md | 10 | 
2 files changed, 38 insertions, 1 deletions
| diff --git a/python-twisted/README.md b/python-twisted/README.md index 2abefd5..ef56afb 100644 --- a/python-twisted/README.md +++ b/python-twisted/README.md @@ -8,7 +8,9 @@ from Pubnub import PubnubTwisted as Pubnub  ```  #### Init +```  pubnub = Pubnub(publish_key="demo", subscribe_key="demo", ssl_on=False) +```  #### Publish Example  ``` @@ -24,7 +26,6 @@ def callback(message):  pubnub.publish(channel, message, callback=callback, error=callback)  ``` -  #### IO Event Loop  ##### VERY IMPORTANT TO ADD THIS LINE AT THE VERY BOTTOM! @@ -68,6 +69,32 @@ def callback(message):  pubnub.history(channel, count=2, callback=callback, error=callback)  ``` +#### Here Now Example +``` +def callback(message): +    print(message) + +pubnub.here_now(channel, callback=callback, error=callback) +``` + +#### Presence Example +``` +channel = 'hello_world' + +def callback(message, channel): +    print(message) + + +def error(message): +    print("ERROR : " + str(message)) + +pubnub.presence(channel, callback=callback, error=callback) +``` + +#### Unsubscribe Example +``` +pubnub.unsubscribe(channel='hello_world') +```  #### IO Event Loop start  ``` diff --git a/python/README.md b/python/README.md index 14d767f..8b46275 100644 --- a/python/README.md +++ b/python/README.md @@ -60,6 +60,16 @@ pubnub.subscribe(channel, callback=callback, error=callback,                   connect=connect, reconnect=reconnect, disconnect=disconnect)  ``` +#### UNSUBSCRIBE + +``` +# Listen for Messages + +channel = 'hello_world' + +pubnub.unsubscribe(channel=channel) +``` +  #### PRESENCE | 
