Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (use-modules (web socket client))
- (use-modules (json))
- (define ws (make-websocket "wss://stream.binance.com:9443/ws/btcusdt@kline_1m"))
- (define (process-response response)
- (let ((json-data (json-string->scm response)))
- (display (format #f "~a" (cdr (car json-data))))))
- ;; Read from the socket
- (let ((message (websocket-receive ws)))
- (while (not (eof-object? message))
- (process-response message)
- (set! message (websocket-receive ws))))
Advertisement
Add Comment
Please, Sign In to add comment