-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbanlist.html
83 lines (73 loc) · 1.99 KB
/
banlist.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ban List Viewer</title>
<style>
table {
width: 100%;
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 10px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h2>Banned Players List</h2>
<table id="banListTable">
<tr>
<th>Steam ID</th>
<th>Ban Time</th>
<th>Ban Reason</th>
<th>Server</th>
</tr>
<!-- Ban list entries will be inserted here by JavaScript -->
</table>
<script>
// Function to fetch ban list and populate the table
// Function to fetch ban list and populate the table
function fetchBanList() {
const apiUrl = 'https://raw.githubusercontent.com/qinastar/palworld-banList/main/ban_info.json';
fetch(apiUrl)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok ' + response.statusText);
}
return response.json();
})
.then(data => {
populateTable(data.ban_list);
})
.catch(error => {
console.error('There has been a problem with your fetch operation:', error);
});
}
// Function to populate the table with ban list data
function populateTable(banList) {
const table = document.getElementById('banListTable');
banList.forEach(player => {
const row = table.insertRow();
const steamIdCell = row.insertCell();
// Remove "steam_" prefix if it exists
const steamId = player.steam_id.replace('steam_', '');
const steamProfileUrl = `https://steamcommunity.com/profiles/${steamId}`;
steamIdCell.innerHTML = `<a href="${steamProfileUrl}" target="_blank">${steamId}</a>`;
row.insertCell().textContent = player.ban_time;
row.insertCell().textContent = player.ban_reason;
row.insertCell().textContent = player.server;
});
}
// Call fetchBanList when the window loads
window.onload = fetchBanList;
</script>
</body>
</html>