-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
37 lines (33 loc) · 1.13 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
<!DOCTYPE html>
<head>
<title>proof of concept I guess</title>
<meta charset="utf-8">
</head>
<body>
<pre>
detect website requests from a university.
try it out, the text below will be different if you visit from a college, otherwise sadmoment.
source: <a href="https://aadibajpai.com/gh/university">https://aadibajpai.com/gh/university</a>
api: <a href="https://uni.aadibajpai.workers.dev">https://uni.aadibajpai.workers.dev</a>
docs: <a href="https://aadibajpai.com/gh/university#api">https://aadibajpai.com/gh/university#api</a>
</pre>
<pre id="uni">
</pre>
</body>
<script>
async function onLoad() {
let response = await fetch("https://uni.aadibajpai.workers.dev")
.then(async (resp) => {
if (resp.ok) return `r u from ${(await resp.text())} bb`;
else return "✨sadmoment nothing found✨";
})
.catch(err => `something went fucky wucky ${err}`);
document.getElementById("uni").innerHTML += response;
}
if (document.readyState != 'loading'){
onLoad();
} else {
document.addEventListener('DOMContentLoaded', onLoad);
}
</script>
</html>