Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import pusherclient
  2. import time
  3.  
  4. PUSHER_KEY = "2ff981bb060680b5ce97"
  5. CHANNEL = "price_ladders_cash_btcjpy_buy"
  6. EVENT = "updated"
  7.  
  8. def callback(data):
  9. print(data)
  10.  
  11. def connect_handler(data):
  12. channel = pusher.subscribe(CHANNEL)
  13. channel.bind(EVENT, callback)
  14.  
  15. pusher = pusherclient.Pusher(PUSHER_KEY)
  16. pusher.connection.bind("pusher:connection_established", connect_handler)
  17. pusher.connect()
  18.  
  19. while True:
  20. time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement