Skip to content

Instantly share code, notes, and snippets.

@Graham42
Last active January 12, 2022 02:51
Show Gist options
  • Save Graham42/05c0318ad4d613ea7fc078a046627c09 to your computer and use it in GitHub Desktop.
Save Graham42/05c0318ad4d613ea7fc078a046627c09 to your computer and use it in GitHub Desktop.
Show All GitHub History for a user
/*
* To use this open your GitHub profile page and then open the browser dev tools
* console and paste this in.
*/
async function sleep(n) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), n);
});
}
async function loadAll() {
let el;
// after the element expands, the class get's changed, so eventually will run out of these
while ((el = document.querySelector(".contribution-activity-show-more"))) {
el.click();
await sleep(2000);
}
}
await loadAll();
async function openAllDetails() {
let els = document.querySelectorAll("details.Details-element");
for (let i = 0; i < els.length; i++) {
if (!els[i].open) {
let summary = els[i].querySelector("summary");
summary.click();
await sleep(100);
}
}
}
await openAllDetails();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment