# Be sure to pip install websocket-client
# Details: https://pypi.org/project/websocket-client/
import websocket
import json
def on_message(ws, message):
with open('data.txt', 'a') as outfile:
json.dump(message, outfile)
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
#print("### closed ###")
f.close
def on_open(ws):
ws.send('{"action":"auth","params":"XXXXX"}')
ws.send('{"action":"subscribe","params":"A.AAPL"}')
f = open("demofile.txt", "a")
if __name__ == "__main__":
# websocket.enableTrace(True)
ws = websocket.WebSocketApp("wss://socket.polygon.io/stocks",
on_message = on_message,
on_error = on_error,
on_close = on_close)
ws.on_open = on_open
ws.run_forever()
Borgata to open new casino in Las Vegas - JTM Hub
ReplyDeleteThe Borgata Hotel Casino & 전라남도 출장샵 Spa 파주 출장안마 in 강원도 출장안마 Atlantic City is located 광주광역 출장샵 on the East Coast's second 아산 출장안마 major shopping circuit. The casino's hotel-casino