Guest User

Untitled

a guest
May 29th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. (use-modules (web socket client))
  2. (use-modules (json))
  3.  
  4.  
  5. (define ws (make-websocket "wss://stream.binance.com:9443/ws/btcusdt@kline_1m"))
  6.  
  7. (define (process-response response)
  8. (let ((json-data (json-string->scm response)))
  9. (display (format #f "~a" (cdr (car json-data))))))
  10.  
  11. ;; Read from the socket
  12. (let ((message (websocket-receive ws)))
  13. (while (not (eof-object? message))
  14. (process-response message)
  15. (set! message (websocket-receive ws))))
  16.  
Advertisement
Add Comment
Please, Sign In to add comment