Last active
May 24, 2017 01:47
-
-
Save 4gus71n/1138a5e6ccd67a5b6c38fbe6624cd79e to your computer and use it in GitHub Desktop.
This file contains 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
<html> | |
<header> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function dec2bin(dec){ | |
return (dec >>> 0).toString(2); | |
} | |
function generateUrls(baseN) { | |
for (i = baseN; i < baseN + 100; i++) { | |
var url = "http://www.omori-game.com/" + dec2bin(i); | |
urlExists(url, function(status, url){ | |
if(status === 200){ | |
$("#container").append("200!!!!!: " + url); | |
} else if(status === 404){ | |
$("#container").append("404: " + url); | |
} else { | |
$("#container").append("CORS: " + url); | |
} | |
$("#container").append("</br>"); | |
}); | |
} | |
} | |
function urlExists(url, cb){ | |
jQuery.ajax({ | |
url: url, | |
crossDomain: true, | |
dataType: 'jsonp', | |
type: 'GET', | |
complete: function(xhr){ | |
if (typeof cb === 'function') cb.apply(this, [xhr.status, url]); | |
} | |
}); | |
} | |
function start() { | |
generateUrls(2397); | |
} | |
$( document ).ready(function() { | |
generateUrls(2397); | |
}); | |
</script> | |
</header> | |
<body> | |
<p id="container"> | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment