Skip to content

Instantly share code, notes, and snippets.

@andeemarks
Created May 8, 2019 06:49
Show Gist options
  • Save andeemarks/32d8d2a7f1dfe88991c8f3e2756b2246 to your computer and use it in GitHub Desktop.
Save andeemarks/32d8d2a7f1dfe88991c8f3e2756b2246 to your computer and use it in GitHub Desktop.
from pubnub.callbacks import SubscribeCallback
from pubnub.enums import PNStatusCategory
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub, SubscribeListener
import logging
import pubnub
pubnub.set_stream_logger('pubnub', logging.DEBUG)
pnconfig = PNConfiguration()
pnconfig.subscribe_key = 'sub-c-5f1b7c8e-fbee-11e3-aa40-02ee2ddab7fe'
pubnub = PubNub(pnconfig)
pubnub.add_listener(SubscribeListener())
pubnub.subscribe().channels('pubnub-sensor-network').execute()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment