-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (62 loc) · 2.29 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
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
<title>Lemmy: FWD</title>
</head>
<body style="margin: 3em; font-family: 'PT Mono', monospace;font-size: 155%;">
<strong>Loading...</strong>
<script type="text/javascript">
//https://aussie.zone/c/sydney
//https://pushka.com/l/#https://aussie.zone/c/sydney
function url_domain(data) {
var a = document.createElement('a');
a.href = data ;
var temphost = a.hostname + "";
temphost = temphost.replace("https://www.", "");
temphost = temphost.replace("http://www.", "");
temphost = temphost.replace("https://", "");
temphost = temphost.replace("http://", "");
return temphost;
} //return hostname / domain only
function url_not_domain(data) {
var subfolder = data.replace(url_domain(data), "");
subfolder = subfolder.replace("https://www.", "");
subfolder = subfolder.replace("http://www.", "");
subfolder = subfolder.replace("https://", "");
subfolder = subfolder.replace("http://", "");
return subfolder;
}//return everything except the domain
window.onload = function(e){
if(window.location.hash) {
// Fragment exists
var url = window.location.hash;
url = url.substring(1);
var domain = url_domain(url) ;
domain = domain.replace("https://www.", "");
domain = domain.replace("http://www.", "");
domain = domain.replace("https://", "");
domain = domain.replace("http://", "");
var subfolder = url_not_domain(url) ;
// subfolder = subfolder.replace("//", "/");
// subfolder = subfolder.replace("//", "/");
var newdomain = "https://beehaw.org" + subfolder+ "@" +domain;
// subfolder = subfolder.replace('https:/c/', "/c/");
newdomain = newdomain.replace("https://www.", "");
newdomain = newdomain.replace("http://www.", "");
newdomain = newdomain.replace("https://", "");
newdomain = newdomain.replace("http://", "");
//alert(newdomain );
//https://beehaw.org/u/[email protected]
//https://beehaw.org/c/[email protected]
window.location.replace("https://"+newdomain);
} else {
// Fragment doesn't exist
//window.location.replace('https://pushka.com');
//alert( 'error-no thing');
window.location.replace('https://beehaw.org/');
}
} // END ONLOAD
</script>
</body>
</html>