JSFiddle - React, Tailwind, and code Playground
by zainshaikh
JavaScript
function get_interval(){
var interval = Math.floor( Math.random() * 5 ) + 1;
console.log('next item will be posted after '+interval + ' minutes.');
return interval * 1000 * 60;
}
function get(){
$.getJSON('http://localhost:59634/TwitterHandler.Web/e.ashx?action=subscriptions&callback=?', function(d){
console.log(d);
setTimeout(get, get_interval());
});
}
setTimeout(get, get_interval());