-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow.html
More file actions
32 lines (28 loc) · 765 Bytes
/
show.html
File metadata and controls
32 lines (28 loc) · 765 Bytes
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
<html>
<head>
<script>
async function show(){
const url1 = new URL(location.search.substring(1));
const subs = url1.pathname.split('/');
const fname = subs[5].substring(0, 12);
var part2 = subs[4];
var part1 = subs[2];
const regexp = /^[a-z0-9]+$/i;
part1 = (part1.match(regexp) || []).join('');
part1 = part1.substring(0,32);
part2 = (part2.match(regexp) || []).join('');
part2 = part2.substring(0,40);
var base = "https://gist.githubusercontent.com/euphobyte/";
base = new URL(part1 + "/raw/" + part2 + '/' + fname , base);
const response = await fetch(base);
const resp = await response.text();
document.open();
document.write(resp);
document.close();
}
</script>
</head>
<body onload="show()">
Loading ..
</body>
</html>