mirror of
https://github.com/EDCD/EDDN.git
synced 2026-10-25 01:06:24 +03:00
Moved Client.py to examples
This commit is contained in:
1 parent
fd9e596552
commit
5b2b2138a4
1 file changed
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
Reference in new issue
Block a user