-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
53 lines (49 loc) · 1.78 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
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Odysseus!</title>
<style>
body {
font: medium sans-serif;
text-align: center;
}
ul {display: block;}
li {display: inline;}
img {height: 128px; width: 128px;}
</style>
<script src="zepto.js"></script>
<script src="md5.js"></script>
<script>
var lang = navigator.language.split("-")[0]
// Make sure we're translating to a supported locale.
if ("en".split(" ").indexOf(lang) < 0) lang = "en"
recommendations = []
$.get("links/" + lang + ".tsv", (text) => $(() => {
for (var line of text.split("\n")) {
line = line.trim()
if (line[0] == "#") continue
links = line.split("\t")
for (var link of links) {
if (link == "") continue
recommendations.push({weight: links.length, href: link})
}
}
for (var link of recommendations) link.order = Math.random()/link.weight
recommendations.sort((a, b) => a.order - b.order)
$('ul').empty()
for (link of recommendations.map((link) => link.href))
$('ul').append($('<li>').append(
$('<a>').attr('href', link).append(
$('<img>').attr('src', "screenshot/" + md5(link) + ".png")
)
))
}))
</script>
</head>
<body>
<h1>Here's some cool links for you to check out!</h1>
<ul><li>Loading...</li></ul>
<p>These links are honest recommendations from <a href="https://github.com/alcinnz">Adrian Cochrane</a>, maintainer of the <a href="https://alcinnz.github.io/Odysseus/">Odysseus Web Browser</a>. None of them paid to be added to this list.</p>
<p>Many of these links are passed on in good-faith from <a href="https://fckdrm.com/">The FckDRM campaign</a>.</p>
</body>
</html>