forked from slazarov/python-bittrex-websocket
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
185 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from time import sleep | ||
|
||
import bittrex_websocket | ||
|
||
if __name__ == "__main__": | ||
class MyBittrexSocket(bittrex_websocket.BittrexSocket): | ||
def on_open(self): | ||
self.nounces = [] | ||
self.msg_count = 0 | ||
|
||
def on_debug(self, **kwargs): | ||
pass | ||
|
||
def on_message(self, *args, **kwargs): | ||
self.nounces.append(args[0]) | ||
self.msg_count += 1 | ||
|
||
|
||
t = ['BTC-ETH', 'ETH-1ST', 'BTC-1ST', 'BTC-NEO', 'ETH-NEO'] | ||
ws = MyBittrexSocket(t) | ||
ws.run() | ||
while ws.msg_count < 20: | ||
sleep(1) | ||
continue | ||
else: | ||
for msg in ws.nounces: | ||
print(msg) | ||
ws.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters