-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
107 lines (97 loc) · 2.86 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
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
99
100
101
102
103
104
105
106
107
<style>
body {
background-image: url("https://coinsh.red/u/lines_2.svg.png");
background-repeat:no-repeat;
background-size:cover;
}
.header {
padding: 60px;
text-align: center;
background: #1abc9c;
color: white;
font-size: 30px;
}
</style>
<div class="header">
<h1 class="logo">IPFS Meta Proxy</h1>
</div>
<script>
function redirect2proxy(input)
{
console.log("redirect2proxy ran with input: " + input);
// Set IPFS Proxies
let proxies = [
"http://coinsh.red",
"https://ipfs.io/ipfs/",
"https://gateway.ipfs.io/ipfs/",
"https://ipfs.infura.io/ipfs/",
"https://rx14.co.uk/ipfs/",
"https://ninetailed.ninja/ipfs/",
"https://ipfs.globalupload.io/",
"https://ipfs.jes.xxx/ipfs/",
"https://10.via0.com/ipfs/",
"https://ipfs.eternum.io/ipfs/",
"https://hardbin.com/ipfs/",
"https://ipfs.wa.hle.rs/ipfs/",
"https://gateway.blocksec.com/ipfs/",
"https://ipfs.renehsz.com/ipfs/",
"htytps://cloudflare-ipfs.com/ipfs/",
"https://ipns.co/",
"https://ipfs.mrh.io/ipfs/",
"https://gateway.originprotocol.com/ipfs/",
"https://gateway.pinata.cloud/ipfs/",
"https://ipfs.doolta.com/ipfs/",
"https://ipfs.sloppyta.co/ipfs/",
"https://ipfs.busy.org/ipfs/",
"https://ipfs.greyh.at/ipfs/",
"https://gateway.serph.network/ipfs/",
"https://jorropo.ovh/ipfs/",
"https://gateway.temporal.cloud/ipfs/",
"https://ipfs.fooock.com/ipfs/",
"https://cdn.cwinfo.net/ipfs/",
"https://ipfs.privacytools.io/ipfs/",
"https://ipfs.jeroendeneef.com/ipfs/",
"https://permaweb.io/ipfs/",
"https://ipfs.stibarc.gq/ipfs/",
"https://ipfs.best-practice.se/ipfs/",
"https://ipfs.2read.net/ipfs/",
"https://storjipfs-gateway.com/ipfs/"
]
var x = Math.floor((Math.random() * proxies.length) + 0);
let proxy = proxies[x]
var input_hash = location.hash;
var hash = input_hash.slice(1);
var hash = hash.replace('ipfs:','');
var url = proxy + hash;
console.log("url is equal to " + url);
window.location.href = url
}
function formdata()
{
var data_short = document.getElementById("short").value;
var data = document.getElementById("url").value;
if (data_short !== "") {
document.writeln("Your IPFS Meta Link Is: " + window.location.href + "#ipfs:" + data_short);
} else {
var data = document.getElementById("url").value;
var data = "ipfs:" + data;
redirect2proxy(data)
}
}
// Proxy Redirect
var input_hash = location.hash;
var hash2 = input_hash[1];
if (hash2 == null) {
console.log("input_has = null or this is broken and it equals: " + hash2 + " or " + input_hash);
} else if (hash2 == "i") {
console.log("input_hash is equal to " + input_hash);
redirect2proxy(input_hash)
}
</script>
<div align="center">
<form><br>
View/Download IPFS file: <input type="text" id="url" placeholder="" /><br><br>
Create Meta Link: <input type="text" id="short" placeholder="" /><br><br>
<input type="submit" value="Submit" onclick="formdata()"/><br>
</form>
</div>