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
<html> | |
<head> | |
<title>WebSocket Test</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.js" integrity="sha512-SxQulwFs2B38bmUJtBSo9tD07MDrtCbY8me3AOZ14tRknCPTeMDLvCQV4ekhs8R0o9QPnW5HQanKfveexVcwLA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
</head> | |
<body> | |
<h1>WebSocket Test</h1> | |
<h2>Open</h2> | |
<div id="onopen"></div> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import http.client | |
import json | |
import urllib.request | |
resp: http.client.HTTPResponse | |
with urllib.request.urlopen('https://api.bybit.com/v2/public/symbols') as resp: | |
data = json.loads(resp.read().decode()) | |
print(*filter(lambda x: all([x['name'] != x['alias'], x['status'] == 'Trading']), data['result']), sep='\n\n') |
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
import asyncio | |
import os | |
import sys | |
import aiohttp | |
from loguru import logger | |
logger.remove() | |
logger.add( | |
sys.stdout, |
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
import asyncio | |
from typing import List | |
import pybotters | |
import streamlit as st | |
async def watch_event( | |
store: pybotters.BybitUSDTDataStore, name: str, result: List, event: asyncio.Event | |
): |
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
import socketio | |
sio = socketio.Client() | |
usdjpy = {} | |
@sio.event | |
def connect(): | |
sio.emit("subscribe", "USDJPY") |
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
#!/usr/bin/env bash | |
set -eux | |
docker run --rm -it \ | |
-u vscode \ | |
-w /home/vscode \ | |
mcr.microsoft.com/devcontainers/python:0-${1:-3.11-bullseye} \ | |
bash |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.