Advertisement
sentero-esp12

Untitled

Aug 26th, 2021
1,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     'use strict';
  3.     console.log('lag check')
  4.     const token = 'MY_TOKEN';
  5.     const doRequest = (e) => {
  6.         if (e.key !== '5') {return}
  7.         console.log('go')
  8.         fetch('https://lichess.org/api/stream/event', {
  9.             headers:
  10.             {
  11.                 Authorization: 'Bearer ' + token,
  12.             },
  13.         })
  14.         .then(response => response.text())
  15.         .then(data => console.log(data));
  16.     }
  17.     document.addEventListener('keydown', doRequest)
  18. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement