Skip to content

Instantly share code, notes, and snippets.

@ridheshcybe
Created September 18, 2021 05:13
Show Gist options
  • Save ridheshcybe/f334154bac19b1fcc4e00ac4d8352130 to your computer and use it in GitHub Desktop.
Save ridheshcybe/f334154bac19b1fcc4e00ac4d8352130 to your computer and use it in GitHub Desktop.
document.querySelectorAll(`[data-testid="like"]`).forEach(e=>e.click())
@ridheshcybe
Copy link
Author

v1

function like() {
    return new Promise((r, j) => {
        document.querySelectorAll(`[data-testid="like"]`).forEach((e, index, arr) => {
            e.click();
            if (index == arr.length - 1) r();
        })
    });
}

function liker() {
    like().then(() => {
        window.scrollBy(0, window.innerHeight);
        liker()
    })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment