Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacon_Space authored Oct 7, 2023
1 parent 7490c5a commit 0215804
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
<title>StreamStats</title>
<link rel="icon" type="image/x-icon" href="default-favicon.ico" id="favicon">
<meta name="og:image" content="default-image-url.png" id="og-image">
<meta name="twitter:image" content="default-image-url.png" id "twitter-image">
<meta name="twitter:image" content="default-image-url.png" id="twitter-image">
<!-- Include Bootstrap CSS -->
<link rel="stylesheet" href="https://streamstats.github.io/TwitchStats/css/main.css">
<script type="text/javascript" src="https://streamstats.github.io/TwitchStats/js/bootstrap.js"></script>
<script type="text/javascript" src="https://streamstats.github.io/Twitch/meta.js"></script>
<script type="text/javascript" src="meta.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
</head>
<body>
<div class="container">
Expand Down Expand Up @@ -42,7 +43,7 @@ <h2>User Information</h2>
let bannedUsers = [];

// Fetch the banned user list from the given URL
fetch('banned.json')
fetch('https://polyextended.github.io/lookup/banned.json')
.then(response => response.json())
.then(data => {
bannedUsers = data.users;
Expand All @@ -61,11 +62,11 @@ <h2>User Information</h2>

// Function to handle the login button click
document.getElementById("login-button").addEventListener("click", () => {
// Replace with your redirect URL
const redirectUrl = "https://streamstats.github.io/TwitchStats"; // Update to the correct URL
// Get the current page's URL
const currentPageUrl = window.location.href;

// Redirect the user to Twitch for authentication
window.location.href = `https://id.twitch.tv/oauth2/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=token&scope=user:read:follows`;
// Redirect the user to Twitch for authentication with the current page's URL as the redirect URI
window.location.href = `https://id.twitch.tv/oauth2/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(currentPageUrl)}&response_type=token&scope=user:read:follows`;
});

// Function to handle the redirect and fetch user data
Expand Down Expand Up @@ -107,8 +108,6 @@ <h2>User Information</h2>
handleRedirect();
}
</script>
<script>

</script>

</body>
</html>

0 comments on commit 0215804

Please sign in to comment.