Skip to content

Instantly share code, notes, and snippets.

@Glorfindel83
Last active Mar 24, 2021
Embed
What would you like to do?
var ok = {};
var deleted = {};
function check(i) {
if (i < 317093) {
console.log(deleted);
console.log(ok);
return;
}
var questionID = i.toString();
$.get("https://meta.stackexchange.com/questions/" + questionID + "/?noredirect=1")
.done(function(data) {
var question = $(data).find("#question");
if (question.attr("data-questionid") != questionID)
return;
let timestamp = new Date(question.find("div.user-action-time:contains(asked)").find("span.relativetime").attr("title"));
let date = new Date(1900 + timestamp.getYear(), timestamp.getMonth(), timestamp.getDate());
if (typeof(ok[date]) == 'undefined') {
console.log("Processing " + date);
ok[date] = 0;
deleted[date] = 0;
}
(question.hasClass("deleted-answer") ? deleted : ok)[date]++;
})
.always(function() {
setTimeout(function() { check(i - 1); }, 1000);
});
}
check(317549);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment