-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
65 lines (58 loc) · 2.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Insta API Front End</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Poppins', sans-serif;
}
#json {
width: 100%;
}
</style>
</head>
<body>
<div class="container text-center">
<div class="fs-1">Insta API</div>
<br>
<div>Extract any Instagram user information for free! (legal)</div>
</div>
<div class="container pt-4">
<div>
<div class="form">
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" id="username_input" placeholder="Username" />
<button id="result" class="btn btn-primary w-100 my-2"
onclick="apiFun(document.getElementById('username_input').value);">Submit</button>
</div>
</div>
<hr>
<div class="container">
<textarea id="json" type="text" rows="20"></textarea>
</div>
<script>
const apiFun = (username) => {// call api
if (!username) {
alert('Please enter a username');
return;
}
document.getElementById("result").setAttribute("disabled", "");
fetch(`http://localhost:5000/${username}`)
.then(response => response.json())
.then(data => {
document.getElementById("json").value = JSON.stringify(data, null, 3);
document.getElementById("result").removeAttribute("disabled");
});
}
</script>
</body>
</html>