use
setInterval(()=> {
$.ajax({
url: "http://www.lazada.com.my/ajax/lottery/spinTheWheel/?lang=en&platform=desktop&wheelToken=b5dd7e9dcbde84b3e11a9ae90d377b02&dpr=2"
})
.done(function( res ) {
if ( res && res.data && res.data.voucherCode ) {
alert(res.data.voucherCode);
console.log( "Voucher:", res.data.voucherCode );
} else {
console.log('wait')
}
});
}, 1000)
in 3 tab
then
var getJSON = function(url) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
resolve(xhr.response);
} else {
reject(status);
}
};
xhr.send();
});
};
setInterval(function() {
getJSON('http://www.lazada.com.my/ajax/lottery/spinTheWheel/?lang=en&platform=desktop&wheelToken=b5dd7e9dcbde84b3e11a9ae90d377b02&dpr=2').then(function(data) {
if(data.data.voucherCode) {
console.log('Voucher: ' + data.data.voucherCode);
}
else { console.log('no voucher'); }
}, function(status) { //error detection....
alert('Something went wrong.');
}); }, 5000);
in 3 tab
so i open 6 incognito tab
I even open Mozilla, Chrome, Opera in their respective incognito still haven't had a success