To get random URLs, you can keep sending GET
request to http://www.uroulette.com/visit/owtqt, and check the expected 302
response status code. If the response status code is 302
, then the location
response header contains the random URL.
Here is an example for collecting 10 random URLs in Node.js:
var http = require('http');
var urls = [];
var visitNum = 10;
function visitUroulette() {
if (visitNum === 0) {
console.log(urls);
return;
}
visitNum--;
console.log('Sending request...');
http.get({
hostname: 'www.uroulette.com',
port: 80,
path: '/visit/owtqt'
}, function(res) {
if (res.statusCode === 302) {
urls.push(res.headers.location);
}
visitUroulette();
});
}
visitUroulette();
Please note uroulette.com has some policy to protect site from data scrapping. In my local test, uroulette.com reset the HTTP connection if the visitNum
in the above code exceeds 86. To get 5000 random URLs, you need to execute the program in various machine, various time.