Skip to content

Instantly share code, notes, and snippets.

@omargfh
Last active January 15, 2023 03:08
Show Gist options
  • Save omargfh/2b29ef2294410a217528adb469041acd to your computer and use it in GitHub Desktop.
Save omargfh/2b29ef2294410a217528adb469041acd to your computer and use it in GitHub Desktop.
Stars all repositories on a page where the "Star" button is visible with 500ms grace period
var fn = (i, total) => {
string = "";
approx = Math.floor(i / total * 20)
for (let n = 0; n < 20; n++) {
if (n <= approx)
string += "█"
else
string += "–"
}
return string;
}
prcg = new Intl.NumberFormat('en', {style: "percent", maximumFractionDigits: 2})
a = Array.from(document.querySelectorAll('button[aria-label="Star this repository"]'))
a.forEach((e, i) => {
setTimeout(() => { e.click(); console.clear(); console.log(`[${fn(i, 30)}] ${prcg.format(i / 30)}`); }, i * 500)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment