Login Register


What's wrong with this JS code? filter_list
Author
Message
What's wrong with this JS code? #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

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

Reply





Messages In This Thread
What's wrong with this JS code? - by Cyb3rNuX - 01-07-2019, 09:31 PM
RE: What's wrong with this JS code? - by mothered - 01-08-2019, 06:18 AM
RE: What's wrong with this JS code? - by Hoss - 01-08-2019, 08:09 AM
RE: What's wrong with this JS code? - by Cyb3rNuX - 01-09-2019, 04:15 AM
RE: What's wrong with this JS code? - by Hoss - 01-09-2019, 04:18 AM
RE: What's wrong with this JS code? - by Cyb3rNuX - 01-09-2019, 05:15 AM
RE: What's wrong with this JS code? - by Hoss - 01-09-2019, 05:42 AM
RE: What's wrong with this JS code? - by Hoss - 01-09-2019, 06:31 AM
RE: What's wrong with this JS code? - by Cyb3rNuX - 01-11-2019, 02:28 PM



Users browsing this thread: