Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- django slack
- 숲을 바라보는 개발자
- AWS Aurora
- 개발자의 마인드
- innodb_buffer_pool_size 오류
- 웹소켓 api
- #알고리즘
- django 슬랙봇
- 개발자와 비즈니스 관계
- public.pem
- add colume
- 비즈니스
- 데이터베이스 오류
- ssl.key
- private.pem
- 슬랙봇
- sed명령어
- 업비트 웹소켓
- 알고리즘
- 정렬
- #백준 #드래곤커브 #알고리즘
- 비즈니스적 관점에서 생각하는 개발자 #개발자 마인드
- slack bot
- 비즈니스적 관점에서 생각하는 개발자
- MySQL
- django slack bot
- 개발자와 비즈니스
- #데이터베이스 #트랜잭션 #ACID #격리수준
- django #django 5.0 #django 5.0 요약
- 개발자에세이
Archives
- Today
- Total
Info-Tech
upbit websocket api사용방법 본문
Upbit Websocket통신 할 수 있는 소스를 구현해봤습니다.
출처 : https://docs.upbit.com/docs/upbit-quotation-websocket
import websocket
import json
try:
import thread
except ImportError:
import _thread as thread
import time
def on_message(ws, message):
get_message = json.loads(message.decode('utf-8'))
print(get_message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("close")
def on_open(ws):
def run(*args):
sendData = '[{"ticket":"test"},{"type":"ticker","codes":["KRW-CPT","KRW-ADA"]}]'
ws.send(sendData)
time.sleep(2)
ws.close()
thread.start_new_thread(run, ())
if __name__ == "__main__":
ws = websocket.WebSocketApp("wss://api.upbit.com/websocket/v1",
on_message = on_message,
on_error = on_error,
on_close = on_close)
ws.on_open = on_open
ws.run_forever()
'프로그래밍 > 파이썬 & 장고' 카테고리의 다른 글
Cron작업을 통해 특정 거래소의 코인 정보들을 실시간으로 확인해보기 (1) | 2018.10.26 |
---|---|
Coingecko [코인 거래 사이트]의 정보를 간단한 크롤링 해보기 (1) | 2018.10.25 |
“SSL: CERTIFICATE_VERIFY_FAILED” 에러 (0) | 2018.10.24 |
Comments