-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheckerr.html
More file actions
98 lines (91 loc) · 3.01 KB
/
checkerr.html
File metadata and controls
98 lines (91 loc) · 3.01 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NOTHING | PAIR WEB</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-image: url("https://files.catbox.moe/ncxavs.jpg"); /* تصویر پسزمینه */
background-repeat: no-repeat;
background-position: center;
background-size: cover; /* تصویر پسزمینه در تمام صفحه */
}
h1, input, button {
color: white; /* رنگ متن سفید */
margin: 10px 0;
}
input, button {
width: 90%;
padding: 10px;
border: none;
border-radius: 5px;
font-size: 16px;
}
input {
background: rgba(255, 255, 255, 0.7); /* رنگ پسزمینه شفاف برای فیلد ورودی */
color: #000;
}
button {
background: #00aaff;
color: #fff;
cursor: pointer;
transition: background 0.3s;
}
button:hover {
background: #0088cc;
}
.result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>BEN-BOT - Fork Checker</h1>
<input type="text" id="username" placeholder="Enter GitHub Username">
<button onclick="checkFork()">Check Fork</button>
<div class="result" id="result"></div>
<script>
async function checkFork() {
const username = document.getElementById('username').value;
const resultDiv = document.getElementById('result');
if (!username) {
resultDiv.textContent = "Please enter a username.";
resultDiv.style.color = "red";
return;
}
const owner = "TraderAn-King"; // مالک مخزن
const repo = "Ben-bot"; // نام مخزن
try {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/forks`);
if (!response.ok) {
throw new Error(`Error: ${response.status}`);
}
const forks = await response.json();
const isForked = forks.some(fork => fork.owner.login === username);
if (isForked) {
resultDiv.textContent = `Yes, ${username} has forked the repository. Wait...`;
resultDiv.style.color = "green";
setTimeout(() => {
window.location.href = "../qr"; // هدایت به ../pair
}, 2000); // زمان تأخیر 2 ثانیه
} else {
resultDiv.innerHTML = `No, ${username} has NOT forked the repository. Please <a href="https://github.com/${owner}/${repo}/fork" target="_blank">fork it here</a>.`;
resultDiv.style.color = "orange";
}
} catch (error) {
resultDiv.textContent = `An error occurred: ${error.message}`;
resultDiv.style.color = "red";
}
}
</script>
</body>
</html>