Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Search global inbox for notification types
let lastPageURL = $("#inbox-pager a:nth-last-child(2)").attr("href");
let lastPage = parseInt(lastPageURL.substring(lastPageURL.indexOf("&page=") + 6));
let baseURL = lastPageURL.substring(0, lastPageURL.indexOf("&page=") + 6);
var itemTypes = {};
function fetchPage(page) {
if (page > lastPage) {
console.log(itemTypes);
return;
}
console.log(baseURL + page);
$.get(baseURL + page, function(data) {
$(data).find("table.history-table tr td:nth-child(3)").each(function() {
let type = this.innerText.trim();
if (typeof itemTypes[type] == "undefined") {
itemTypes[type] = page;
}
});
window.setTimeout(function() {
fetchPage(++page);
}, 100);
});
}
fetchPage(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.