Skip to content

Instantly share code, notes, and snippets.

@kedare kedare/
Created Feb 20, 2019

What would you like to do?
import json
import websocket
import pymongo
from pprint import pprint
# Mongo Connect
mongo = pymongo.MongoClient("mongodb://ris:ris@localhost:27017")
db = mongo.ris
collection = db.changes
# WS Connect
ws = websocket.WebSocket()
params = {
"moreSpecific": True,
"host": "rrc21",
"socketOptions": {
"includeRaw": True
"type": "ris_subscribe",
"data": params
# Process data
for data in ws:
loaded_data = json.loads(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.