Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="twitch"></div>
- async function getData(url = 'https://api.twitch.tv/helix/streams?user_id=channelnamehere', data = {method, headers}) {
- const response = await fetch('https://api.twitch.tv/helix/streams?user_id=channelnamehere', {
- method: 'GET',
- headers: {
- Client-ID: 'enteridhere';
- }
- });
- if (response == null){
- document.write(0)
- }
- else {
- document.getElementById("twitch").innerHTML = 'embedtwitchplayerhere';
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement