Skip to content

Create a page to show who is live on Twitch right now#120

Open
BenDMyers wants to merge 6 commits into
mainfrom
live-page
Open

Create a page to show who is live on Twitch right now#120
BenDMyers wants to merge 6 commits into
mainfrom
live-page

Conversation

@BenDMyers
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/_data/streamers.json
Comment on lines +2 to +9
"5t3phDev",
"BuildingBedrockLayout",
"lunchdev",
"marbiano",
"SomeAnticsDev",
"stepzen_dev",
"ThoriumSim",
"TrostCodes"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got FOMO here 😿

Comment thread src/live/live.11tydata.js
Comment on lines +12 to +23
async function isStreaming(channel) {
const {
data: { data: streams },
} = await axios.get(`https://api.twitch.tv/helix/streams?user_login=${channel}`, {
headers: {
'Client-ID': process.env.TWITCH_CLIENT_ID,
Authorization: `Bearer ${accessToken}`,
},
});

return streams.length > 0;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to throw in a catch here and return false for safety

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants