diff options
| author | Devendra | 2014-06-17 02:43:16 +0530 | 
|---|---|---|
| committer | Devendra | 2014-06-17 02:43:16 +0530 | 
| commit | c731ae584de53da55ed799f8fd59bff10b9b9b72 (patch) | |
| tree | 9ab66fdafaf833367cb860f6c808c6801453746b /python-twisted/README | |
| parent | 05dbe7714645c65bce4a73ec11d8d424f5fae296 (diff) | |
| download | pubnub-python-c731ae584de53da55ed799f8fd59bff10b9b9b72.tar.bz2 | |
readme changes
Diffstat (limited to 'python-twisted/README')
| -rw-r--r-- | python-twisted/README | 78 | 
1 files changed, 0 insertions, 78 deletions
| diff --git a/python-twisted/README b/python-twisted/README deleted file mode 100644 index 402fb34..0000000 --- a/python-twisted/README +++ /dev/null @@ -1,78 +0,0 @@ -## --------------------------------------------------- -## -## YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. -## http://www.pubnub.com/account -## -## ---------------------------------------------------- - -## ---------------------------------------------------- -## PubNub 3.1 Real-time Cloud Push API - PYTHON TWISTED -## ---------------------------------------------------- -## -## www.pubnub.com - PubNub Real-time Push Service in the Cloud.  -## http://github.com/pubnub/pubnub-api/tree/master/python-twisted/ -## -## PubNub is a Massively Scalable Real-time Service for Web and Mobile Games. -## This is a cloud-based service for broadcasting Real-time messages -## to thousands of web and mobile clients simultaneously. - - -from Pubnub import PubnubTwisted as Pubnub - -## --------------- -## Python Push API -## --------------- -pubnub = Pubnub(publish_key="demo", subscribe_key="demo", ssl_on=False) - -## ----------------------------------------------------------------------- -## IO Event Loop -## ----------------------------------------------------------------------- -## VERY IMPORTANT TO ADD THIS LINE AT THE VERY BOTTOM! -## -## pubnub.start() ## IMPORTANT! -## - -## ----------------------------------------------------------------------- -## Subscribe Example -## ----------------------------------------------------------------------- - -channel = 'hello_world' - -def callback(message, channel): -    print(message) - - -def error(message): -    print("ERROR : " + str(message)) - - -def connect(message): -    print("CONNECTED") - - -def reconnect(message): -    print("RECONNECTED") - - -def disconnect(message): -    print("DISCONNECTED") - - -pubnub.subscribe(channel, callback=callback, error=callback, -                 connect=connect, reconnect=reconnect, disconnect=disconnect) - - -## ----------------------------------------------------------------------- -## History Example -## ----------------------------------------------------------------------- -def callback(message): -    print(message) - -pubnub.history(channel, count=2, callback=callback, error=callback) - - - -## ----------------------------------------------------------------------- -## IO Event Loop -## ----------------------------------------------------------------------- -pubnub.start() | 
