Skip to content

Instantly share code, notes, and snippets.

@Glorfindel83
Last active March 24, 2021 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Glorfindel83/b2c69bc646f6174b0b65679eb593f32a to your computer and use it in GitHub Desktop.
Save Glorfindel83/b2c69bc646f6174b0b65679eb593f32a to your computer and use it in GitHub Desktop.
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