Skip to content

Instantly share code, notes, and snippets.

@4gus71n
Last active May 24, 2017
Embed
What would you like to do?
<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