What's wrong with this JS code? 01-07-2019, 09:31 PM
#1
So I was making simple javascript code for auto-following on Instagram: follows 25 users, then waits for 10 minutes and does it again.
Yet I get this exception (when pasting it into console on Instagram website): Uncaught SyntaxError: await is only valid in async function on line 11
I believe it's something up to waiting function (obviously), but I'm not sure how to fix it. Any ideas?
Yet I get this exception (when pasting it into console on Instagram website): Uncaught SyntaxError: await is only valid in async function on line 11
Code:
start:
function sleep(ms) {
 return new Promise(resolve => setTimeout(resolve, ms));
}
var items = document.querySelectorAll("._0mzm-");
for (var i = 0; i < 25; i++) {
  if (items[i].innerText === "Follow") {
items[i].click();
  }
}
await sleep(601500);
goto start;I believe it's something up to waiting function (obviously), but I'm not sure how to fix it. Any ideas?
(This post was last modified: 01-07-2019, 09:32 PM by Cyb3rNuX.)
Profitable dating, shopping, VPN, finance checkers - Click here to visit!
Website: kidux.net, Telegram group: t.me/kiduxcheckers
Website: kidux.net, Telegram group: t.me/kiduxcheckers



![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)











