Skip to content

Instantly share code, notes, and snippets.

@4gus71n
Last active May 24, 2017 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4gus71n/1138a5e6ccd67a5b6c38fbe6624cd79e to your computer and use it in GitHub Desktop.
Save 4gus71n/1138a5e6ccd67a5b6c38fbe6624cd79e to your computer and use it in GitHub Desktop.
<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