Skip to content

Conversation

@vpetrigo
Copy link
Contributor

@vpetrigo vpetrigo commented Jul 2, 2023

Sync Twitch API scopes according to the latest specification available here.

I used the following code to generate variable-scope code. It may be helpful for further syncs. 😅

let scopeNames = Array.from(document.getElementsByClassName(
    'highlighter-rouge')).filter(element => element.innerText
    .match(/^[a-z:]+$/));

for (let i of scopeNames) {
    let elementText = i.innerText;
    let capitalizedScopeName =
        `Scope${elementText.split(/[:_]/).map((element) => element.charAt(0).toUpperCase() + element.slice(1)).join('')}`;
    console.log(`${capitalizedScopeName} = "${elementText}"`);
}

@techknowlogick techknowlogick merged commit a3b41a0 into markbates:master Sep 6, 2023
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