forked from gildas-lormeau/SingleFile-Archives
-
Notifications
You must be signed in to change notification settings - Fork 0
/
read.htm
54 lines (43 loc) · 1.87 KB
/
read.htm
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">.
<title>A lire</title>
</head>
<script>
(async () => {
const response = await fetch("https://api.github.com/repos/Djiril/SingleFile-Archives/contents/");
const files = await response.json();
const listElement = document.createElement("ul");
for (const file of files) {
if (file.name.includes(".html")) {
const itemElement = document.createElement("li");
const linkElement = document.createElement("a");
linkElement.href = file.path;
linkElement.textContent = file.name;
linkElement.target = "_blank";
itemElement.appendChild(linkElement);
listElement.appendChild(itemElement);
}
}
const itemElement = document.createElement("li");
listElement.appendChild(itemElement);
for (const file of files) {
if (file.name.includes(".html")) {
const itemElement = document.createElement("li");
const linkElement = document.createElement("a");
linkElement.href = "https://getpocket.com/edit?url=http://read.cincet.net/"+file.path;
linkElement.textContent = file.name;
linkElement.target = "_blank";
itemElement.appendChild(linkElement);
listElement.appendChild(itemElement);
}
}
document.body.appendChild(listElement);
})();
</script>
<body>
Hey!
</body>
</html>