mirror of
https://github.com/EDCD/EDDN.git
synced 2025-05-02 16:11:31 +03:00
22 lines
478 B
Python
22 lines
478 B
Python
import zlib
|
|
import zmq.green as zmq
|
|
import simplejson
|
|
import sys
|
|
|
|
|
|
def main():
|
|
context = zmq.Context()
|
|
subscriber = context.socket(zmq.SUB)
|
|
|
|
subscriber.setsockopt(zmq.SUBSCRIBE, "")
|
|
subscriber.connect('tcp://eddn-relay.elite-markets.net:9500')
|
|
|
|
while True:
|
|
market_json = zlib.decompress(subscriber.recv())
|
|
market_data = simplejson.loads(market_json)
|
|
print market_data
|
|
sys.stdout.flush()
|
|
|
|
if __name__ == '__main__':
|
|
main()
|