-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
105 lines (87 loc) · 4.06 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>rev=canonical: url shortening that doesn't hurt the internet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
html {
background-color: #000c82;
color: black; /* always set color if you set background */
}
body {
width: 640px;
margin: 0px auto;
font-family: Arial,Helvetica,sans-serif;
font-size: 16px;
}
#main { background-color: white; padding: 30px;}
h1, h2, h3 {
font-family: 'Helvetica Neue','Helvetica','Arial',sans-serif;
font-weight: bolder;
letter-spacing: -1px;
margin-bottom: 0;
}
h1 { color: #FFD700; }
p { margin-top: 0;}
code {
font-family: monaco, fixed;
font-size: 12px;
}
li {
font-size: 18px;
}
</style>
</head>
<body>
<div id="main">
<h1 style="display: inline;">RevCanonical</h1>
<div style="color: #FF5f1b; display: inline;">url shortening that doesn't hurt the internet</div>
{% if not link %}
<form method="get" action="">
<p><label for="url">Enter Web Address (URL) Here:</label></p>
<div>
<input type="text" name="url" id="url" value="{{ url }}" size="60">
<input type="Submit" name="Shorten" value="Shorten">
</div>
</form>
{% else %}
<p>Rev-canonicalized URL! <em>(hopefully shorter):</em></p>
<div><input type="text" value="{{ link }}" size="60"></div>
<p><small><a href="/">do another?</a></small></p>
{% endif %}
{% if error %}
<p>Whoops, we encountered an error: {{ error }}</p>
{% endif %}
<div id="explanation">
<h3>Huh?</h3>
<p>RevCanonical is url shortening with a twist. Instead of creating its own super short versions of links, it checks to see if the link owner has published a shortened version of the given page using HTML link element. If not, we just return the original URL. And you should bug the link owner about providing a better alternative.</p>
<h3>Why?</h3>
<p>URL shorteners are as problematic as they are useful. They create <acronym title="Single Points of Failure">SPOFs</acronym>, that over any meaningful timeframe are guaranteed to create data loss, eroding the historical record. And then there are the privacy concerns. And the usability ones. See also <a href="http://joshua.schachter.org/2009/04/on-url-shorteners.html">on url shorteners</a>
and <a href="http://www.scripting.com/stories/2009/03/07/solvingTheTinyurlCentraliz.html">Solving the TinyUrl centralization problem</a>.</p>
<h3>Details?</h3>
<p>RevCanonical searches the referenced resource for:</p>
<ul>
<li><code><link rev="canonical" href="..."></code> (i.e. "I am the canonical URL of that page over there")</li>
<li><code><link rel="alternate shorter" href="..."></code> (or truth be told any link rel including the string "alternate short*")</li>
</ul>
<p>There is also an <a href="/api">API</a> version, which returns just the resulting URL.</p>
<h3>Seriously?</h3>
<p>Well sort of. There aren't many sites which support it, but there should be.</p>
<p>Check out the <a href="http://revcanonical.wordpress.com/">RevCanonical blog</a> for more details about who support <code>rev="canonical"</code>, and why.
</p>
<!-- Not entirely true. There's at least http://gist.github.com/90889 -->
</div>
</div>
<p style="background-color: white; text-align:center; margin-top:5px; padding: 5px;">
<small>code by <a href="http://laughingmeme.org">kellan</a>, light design feedback by <a href="http://brandxculture.com">jasmine</a>. another "30 minutes or less" production.</small>
</p>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-571486-6");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body>
</html>