WK_of_Angmar

Reddit - "Gabe N" imgur Random Images

Aug 4th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 9.00 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Gabe N imgur links</title>
  6. <script type="text/javascript">
  7. //By Wk_of_Angmar
  8. //Don't look at me. :(
  9. //I'm no programmer so this won't be the most efficient script you've seen.
  10.  
  11. var totalTests = 0, linkNumber = 0;
  12.  
  13. function getImage() {
  14.     var test = new Array,
  15.     //Here are the different possible combinations of what letters could be considered as a potential substitute for the letters in "Gabe N".
  16.     g = ['g','G','9','6'],
  17.     a = ['a','A','4'],
  18.     b = ['b','B','8','6'],
  19.     e = ['e','E','3'],
  20.     n = ['n','N'];
  21.     //Creates all the possible combinations of above and passes them to testImage().
  22.     for (var gcounter = 0; gcounter <= g.length - 1; gcounter++) {
  23.         test[0] = g[gcounter];
  24.         for (var acounter = 0; acounter <= a.length - 1; acounter++) {
  25.             test[1] = a[acounter];
  26.             for (var bcounter = 0; bcounter <= b.length - 1; bcounter++) {
  27.                 test[2] = b[bcounter];
  28.                 for (var ecounter = 0; ecounter <= e.length - 1; ecounter++) {
  29.                     test[3] = e[ecounter];
  30.                     for (var ncounter = 0; ncounter <= n.length - 1; ncounter++) {
  31.                         test[4] = n[ncounter];
  32.                         var output = test.join("");
  33.                         testImage(output);
  34.                     }
  35.                 }
  36.             }
  37.         }
  38.     }
  39. }
  40.  
  41. function testImage(input) {
  42.     totalTests++;
  43.     var testImage = new Image();
  44.     //Checks whether or not the image is valid or non-existant. I had originaly attempted to create a new canvas and use the dataToURL() method to convert the image to Base64 and then compare that with the "does not exist" image that is used by imgur, however I had security errors (I believe due to the fact that the image is on a different domain) when attempting to use the method. Therefore, this script just compares the dimenions of the image. This is certainly faster, however it can produce false positives if the dimensions of a valid image are the same as the "does not exist" image, though that's very unlikely. Furthermore, if the "does not exist" image's dimensions are altered by imgur, this script will break. If anyone else has an alternative method of comparing the images, please post a message to www.reddit.com/user/Wk_Of_Angmar.
  45.     testImage.onload = function() {
  46.         if (testImage.height == 81 && testImage.width == 161) {
  47.             return;
  48.         } else {
  49.             linkNumber++;
  50.             insertImage(input);
  51.         }
  52.     }
  53.     testImage.src = "http://i.imgur.com/" + input + ".jpg";
  54. }
  55.  
  56. function insertImage(validLink) {
  57.     var newElement = document.createElement("div");
  58.     newElement.setAttribute("class", "validResult");
  59.     var newID = "validResult" + validLink;
  60.     newElement.setAttribute("id", newID);
  61.     var newText = "<h1>Here is image #" + linkNumber + ": " + validLink + "</h1>" + "<div class='image'><img class='validImage' id='validImage" + validLink + "' src='http://i.imgur.com/" + validLink + ".jpg'></div><div class='validInfo' id='validInfo" + validLink + "'><p class='linkInfo'>Direct link:</p><input type='text' readonly='readonly' class='directLink' value='" + "http://i.imgur.com/" + validLink + ".jpg" + "'></input>" + "<p class='miniLinks'><a href='http://i.imgur.com/" + validLink + ".jpg' target='_blank'>Open (new tab)</a> | <a href='http://i.imgur.com/" + validLink + ".jpg' target='_top'>Open (current window)</a></p>" + "<p class='indirectLinkInfo'>Indirect link:</p><input type='text' readonly='readonly' class='indirectLink' value='" + "http://imgur.com/" + validLink + "'></input>" + "<p class='miniLinks'><a href='http://imgur.com/" + validLink + "' target='_blank'>Open (new tab)</a> | <a href='http://imgur.com/" + validLink + "' target='_top'>Open (current window)</a></p>" + "</div>";
  62.     document.body.appendChild(newElement);
  63.     document.getElementById(newID).innerHTML = newText;
  64. }
  65.  
  66. window.onload = function() {
  67.     getImage();
  68. }
  69. </script>
  70. <style type="text/css">
  71. /* Resets CSS for cross browser compatibility. */
  72. html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
  73.  
  74. body {
  75.     font-family: Calibri;
  76.     font-size: 15px;
  77.     background-color: rgb(229, 229, 229);
  78.     background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAJdnBBZwAAADAAAAAwAM7ujFcAAAdzSURBVFjDVdjbddtIEgbgj7Ye+lGOQM0MlAGbEYwdARsRzGwEICKwHQGACHYdAcAIdhwBwAysCLAPKHG80jm8gGCjUfXfioecegWrTvai6pwUsxtOVtWgGnDXOptwNDnaDDoLjoqTm9WEWRfPq0OfilWnYLBoXDSKVS87WnROKFaz0QVZ1ul1ZmS9o+oiW83uVq1VwcyW+jSlLW2pppq2VNKWrmlJJfVpS9c4sqUtXeOzLW0pp5q2NKWSrmlLU8pJyumaprSlmkq6phLrfqxPo2fPvvvDT8/uPsuy0Sc3V1dZ59ns1d2zajb6qjF684cfOn+5qX5ZjZ4Vd7/8gR+effz59OyuKrJfnv1w9+qLi5++yl6tXvFs1FsdHfzCfzy7+uKrN1Xxw1dvvhr95bPvvvmCq6dJ44RBRXFzkk06qxkDbi6y3tmkBhS4oY3e3fRoHWXNoysDLKlPS9rSkpa0pZquaUo1TWlLovI1nvfHKdW0pCX16ZquaUvXlKM3NS2pTzlNSdqStKScSvqQVdnZUYfeSQmYFhy1OJsNOqxWWafRaeP9omicrFbVYtSbbRoFhy2xyhpcFNBoZTR6R0V2cnPCGiA9qnqDmwvBo1km3nVORhfZB0GyH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0ntY+ESPjaEL1WtWXG2qlZZaw/n78bYxZHbQ692fNUH7uySu6XykNt//ksQb2fpFtx+5/r24PQSIv8P/6+pJumatvTx9vTND8VPf3nVuYVivmr8qbjLsi8+WTH6pPHZDaPGs1dvvihunv3t1Ss+Kz4b/dvR0+yoyk4xpdwVN9Wg1RhdzCHZk7P2QbzGZNUbrCYl9DVHhFuNUaZDTflh+82DC7OKF1SDogkzh5Msm+0j1RC9WKILHJToQ8NuOG1o/RRppg+ln7BqTDFKrU5G02+201icXQKUx6DhS1y6Wj0dA3Sd2dkViz2tlTD1KXiwGly0Oqcw1CkMPrsrYUp9sIHqvDO5Ruaf0hJz2BKz1zWQ8G75OfDT/8baLZhckpgoasrBfqmkJxFYdi18eRg3tPZB9l2NiqPeoHOPsbc4WkzWKN3O9rMBrcXqMKXRyd2gelHNblanh9Xv8rW/Gx7LvF+u6B/TxGwkyLhGmG59KLKsVbWyoxt6t+D1LhaVWL6N5WclhHuNDL7Py9mLwTmCcTY69KmGzO3jBvkx1B21bo8QvE8wndWqN8oPe9nlb3WULeGEZRcKT3dHvT2kT45R/SlQMsfNrwG8LnCzq1Fj1aiPGFOjn/fo3WL2NMSYt8fz/rcWTwbZXZWtWlQ1jGY3l6LK0ZeDLYCx/8qx39vNIacpFhzih5ARe4zMMW3uan+OsLhrfg4pv3kJIb8/5s7Rqo20fujTjpB3wnlUdW/TXqRz5I19utnl++RmsBjcvI8ru/W3YTgXmZ0+e7qZwu6mB4Wuj5S0hHi/H9lTdY6QltOWpGvqU45MtIUF/w/LXTUjiJxjJgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMi0wMy0xMlQxMzowNToxOCswMTowMHZskaYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTItMDMtMTJUMTM6MDQ6NTUrMDE6MDANbi0eAAAAAElFTkSuQmCC), linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
  79.     background-attachment: fixed;
  80. }
  81.  
  82. h1 {
  83.     font-weight: bold;
  84.     text-align: center;
  85.     background-color: rgba(0,0,0,0.08);
  86.     border-top-left-radius: 5px;
  87.     border-top-right-radius: 5px;
  88.     padding: 5px 0;
  89. }
  90.  
  91. .validResult {
  92.     background-color: rgba(255,255,255,0.4);
  93.     margin: 10px auto;
  94.     border-radius: 5px;
  95.     width: 800px;
  96.     height: 300px;
  97. }
  98.  
  99. .validImage {
  100.     max-height: 251px;
  101.     max-width: 360px;
  102. }
  103.  
  104. .validInfo {
  105.     float: right;
  106.     width: 400px;
  107.     margin-top: 12.5px;
  108. }
  109.  
  110. .image {
  111.     float: left;
  112.     width: 400px;
  113.     height: 262.5px;
  114.     padding-top: 12.5px;
  115.     text-align: center;
  116. }
  117.  
  118. .linkInfo {
  119.     margin: 0px 0px 3px 0px;
  120.     border-radius: 5px;
  121.     width: 377px;
  122.     padding: 3px 0px 3px 5px;
  123.     background-color: rgba(0,0,0,0.08);
  124.     font-size: 12px;
  125. }
  126.  
  127. .indirectLinkInfo {
  128.     margin: 16px 0px 3px 0px;
  129.     border-radius: 5px;
  130.     width: 377px;
  131.     padding: 3px 0px 3px 5px;
  132.     background-color: rgba(0,0,0,0.08);
  133.     font-size: 12px;
  134. }
  135.  
  136. .directLink {
  137.     margin-top: 10px;
  138.     border: 1px dashed rgba(0,0,0,0.4);
  139.     padding: 3px;
  140.     width: 371px;
  141.     background-color: rgba(255,255,255,0.5);
  142. }
  143.  
  144. .indirectLink {
  145.     margin-top: 10px;
  146.     border: 1px dashed rgba(0,0,0,0.4);
  147.     padding: 3px;
  148.     width: 371px;
  149.     background-color: rgba(255,255,255,0.5);
  150. }
  151.  
  152. .miniLinks {
  153.     font-size: 10px;
  154.     margin-top: 3px;
  155. }
  156.  
  157. .miniLinks a:link, .miniLinks a:visited {
  158.     color: grey;
  159.     text-decoration: none;
  160. }
  161.  
  162. .miniLinks a:hover {
  163.     color: rgb(173,173,173);
  164. }
  165.  
  166. .clipboardLink {
  167.     cursor: pointer;
  168. }
  169. </style>
  170. </head>
  171. </html>
Add Comment
Please, Sign In to add comment