-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
121 lines (101 loc) · 5.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kick Channel Tracker</title>
<link rel="stylesheet" href="https://streamstats.github.io/KickStats/main.css" type="text/css" />
<!-- Add your custom Bootstrap CSS link here -->
</head>
<body>
<div class="container text-center">
<h2 class="label label-success display-5" style="width: 200px;">KickStats Viewer</h2>
<hr class="my-2">
<div>
<input type="text" id="channelInput" placeholder="Kick Username" class="form-control" style="width: 200px; display: inline-block;">
<input type="button" id="getProfileBtn" class="btn btn-primary" value="Get Profile">
</div>
<div class="profile">
<!-- The fetched channel information will be displayed here -->
<div class="channelInfo" id="channelInfo">
<!-- Loading or error message will be displayed here -->
</div>
</div>
<hr class="my-2">
<footer>© StreamStats 2017 </footer>
</div>
<!-- Include Moment.js library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script>
let bannedUsers = [];
// Fetch banned users when the script starts
(async function fetchBannedUsers() {
bannedUsers = await getBannedUsers();
})();
async function getBannedUsers() {
try {
const response = await fetch('https://polyextended.github.io/banned.json');
const data = await response.json();
return data.BannedUsers.map(user => user.toLowerCase()) || [];
} catch (error) {
console.error('Error fetching banned users:', error);
return [];
}
}
document.getElementById('getProfileBtn').addEventListener('click', async function () {
const channelName = document.getElementById('channelInput').value;
getChannelInfo(channelName);
});
// Call getBannedUsers every 3 minutes
setInterval(async () => {
bannedUsers = await getBannedUsers();
}, 3 * 60 * 1000);
async function getChannelInfo(channelName) {
try {
// Check if the user is banned
const isBanned = bannedUsers.includes(channelName.toLowerCase());
// Display banned message if the user is banned
if (isBanned) {
document.getElementById('channelInfo').innerHTML = '<p>User is banned</p>';
return;
}
// Add logic here to fetch channel information and update the display
const response = await fetch(`https://kick.com/api/v1/channels/${channelName}`);
const data = await response.json();
// Format the "Joined on" date using Moment.js
const joinedDate = moment(data.user.email_verified_at).format('MMMM DD, YYYY');
// Display channel information
const channelInfoHTML = `
<center>
<img src="${data.user.profile_pic}" width="50%" style="border:3px solid red">
<h1><span class="label label-success">${data.user.username}</span></h1>
<br /><b><span class="label label-success">Followers: ${data.followersCount}</span></b>
<br /><b><span class="label label-success">Can Host: ${data.can_host}</span></b>
<br />
<br /><b><span class="label label-success">Current Status: ${data.livestream ? 'Online' : 'Offline'}</span></b>
<br />
<br /><b><span class="label label-info"><font color="White"><a href="https://kick.com/${data.user.username}">Kick.com/${data.user.username}</a></font></span></b>
<br /><b><span class="label label-danger">Partnered: ${getPartnerStatus(data.subscription_enabled)}</span></b>
<br /><b><span class="label label-danger">ID: ${data.user.id}</span></b>
<br /><b><span class="label label-primary">Has mature content: ${data.mature}</span></b>
<br /><b><span class="label label-primary">Last Played: ${data.lastPlayed}</span></b>
<br /><b><span class="label label-success">Vods on: ${data.vod_enabled}</span></b>
<br /><b><span class="label label-success">Joined on: ${joinedDate}</span></b>
`;
document.getElementById('channelInfo').innerHTML = channelInfoHTML;
} catch (error) {
console.error('Error fetching channel info:', error);
document.getElementById('channelInfo').innerHTML = `<p>Error: ${error.message}</p>`;
}
}
// Function to get partner status
function getPartnerStatus(subscriptionEnabled) {
return subscriptionEnabled ? 'Yes' : 'No';
}
</script>
<!-- Remove Materialize JS scripts and add your custom Bootstrap JS scripts here -->
<!-- Example: -->
<!-- <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> -->
<!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> -->
</body>
</html>