Created
May 13, 2015 19:40
-
-
Save LennyPenny/67516e02b626458b48b3 to your computer and use it in GitHub Desktop.
fcpn.ch 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>fcpn.ch redirecting...</title> | |
<script type="text/javascript"> | |
var hash = window.location.hash.slice(1); | |
if (hash == "") { | |
window.location = "shortn" | |
} else { | |
var lookUp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
function b62to10(str) { | |
var res = 0; | |
for (var idx = 0; idx < str.length; idx++) { | |
var character = str.charAt(idx); | |
var pos = lookUp.indexOf(character); | |
res = res + pos * Math.pow(62, idx); | |
} | |
return res; | |
} | |
var postID = b62to10(hash); | |
window.location = "http://facepunch.com/showthread.php?p=" + postID + "#post" + postID; | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment