Skip to content

Instantly share code, notes, and snippets.

@JoshuaKGoldberg
Last active September 15, 2023 13:10
Show Gist options
  • Select an option

  • Save JoshuaKGoldberg/3876ed731e5bf09d280d4ae7b5f23d7d to your computer and use it in GitHub Desktop.

Select an option

Save JoshuaKGoldberg/3876ed731e5bf09d280d4ae7b5f23d7d to your computer and use it in GitHub Desktop.

Revisions

  1. JoshuaKGoldberg revised this gist Sep 15, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion accept-all-repository-packages.js
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ async function acceptVisiblePackages() {
    }
    }

    for (const pager of document.querySelectorAll(".pagination-list li") {
    for (const pager of document.querySelectorAll(".pagination-list li")) {
    pager.click();
    await waitFor(2500); // todo: be more intelligent
    await acceptVisiblePackages();
  2. JoshuaKGoldberg revised this gist Sep 15, 2023. 2 changed files with 25 additions and 19 deletions.
    25 changes: 25 additions & 0 deletions accept-all-repository-packages.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    function waitFor(time) {
    return new Promise((resolve) => setTimeout(resolve, time));
    }

    async function acceptVisiblePackages() {
    const containers = document.querySelectorAll("#container");
    for (const container of containers) {
    container.click();
    await waitFor(500);

    const choice = document.querySelector(`[value=repository_license]`);
    choice.scrollIntoView();
    choice.click();
    await waitFor(500);

    document.querySelector(".drawer-card-foot button").click();
    await waitFor(500);
    }
    }

    for (const pager of document.querySelectorAll(".pagination-list li") {
    pager.click();
    await waitFor(2500); // todo: be more intelligent
    await acceptVisiblePackages();
    }
    19 changes: 0 additions & 19 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1,19 +0,0 @@
    async function goThroughLicenseFlow() {
    const waitFor = (time) => new Promise((resolve) => setTimeout(resolve, time));

    const container = document.getElementById("container");
    container.click();
    await waitFor(500);

    const choice = document.querySelector(`[value=repository_license]`);
    choice.scrollIntoView();
    choice.click();
    await waitFor(500);

    document.querySelector(".drawer-card-foot button").click();
    await waitFor(500);
    }

    while (true) {
    await goThroughLicenseFlow();
    }
  3. JoshuaKGoldberg created this gist Sep 15, 2023.
    19 changes: 19 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    async function goThroughLicenseFlow() {
    const waitFor = (time) => new Promise((resolve) => setTimeout(resolve, time));

    const container = document.getElementById("container");
    container.click();
    await waitFor(500);

    const choice = document.querySelector(`[value=repository_license]`);
    choice.scrollIntoView();
    choice.click();
    await waitFor(500);

    document.querySelector(".drawer-card-foot button").click();
    await waitFor(500);
    }

    while (true) {
    await goThroughLicenseFlow();
    }