Last active
March 24, 2021 20:34
-
-
Save Glorfindel83/b2c69bc646f6174b0b65679eb593f32a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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