Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <div id="twitch"></div>
  2.  
  3. async function getData(url = 'https://api.twitch.tv/helix/streams?user_id=channelnamehere', data = {method, headers}) {
  4. const response = await fetch('https://api.twitch.tv/helix/streams?user_id=channelnamehere', {
  5. method: 'GET',
  6. headers: {
  7. Client-ID: 'enteridhere';
  8. }
  9. });
  10.  
  11. if (response == null){
  12. document.write(0)
  13. }
  14. else {
  15. document.getElementById("twitch").innerHTML = 'embedtwitchplayerhere';
  16. };
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement