Skip to content

Instantly share code, notes, and snippets.

@pocesar
Last active October 22, 2021 11:19
Show Gist options
  • Select an option

  • Save pocesar/3af3d73479c8f67a234f30e40ffcd41e to your computer and use it in GitHub Desktop.

Select an option

Save pocesar/3af3d73479c8f67a234f30e40ffcd41e to your computer and use it in GitHub Desktop.

Revisions

  1. pocesar revised this gist Aug 9, 2018. No changes.
  2. pocesar created this gist Aug 9, 2018.
    30 changes: 30 additions & 0 deletions nuke.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    (async function walk() {
    const waiter = (time) => (new Promise((resolve, reject) => {
    setTimeout(resolve, time)
    }))

    const photo = document.querySelector('._3-8h._50zy._50-0._50z_._5upp._42ft')
    const okBtn = '.uiOverlayFooter ._4jy0._4jy3._4jy1._51sy.selected._42ft'

    if (photo) {
    photo.click()

    let l = 1
    while (true) {
    await waiter(1000 * l++)
    let k = document.querySelector(okBtn)

    if (k) {
    k.click()
    while (document.querySelector(okBtn)) {
    await waiter(100)
    }
    break
    }
    }
    } else {
    return alert('done?');
    }

    setTimeout(walk, 1000);
    })()