Skip to content

Instantly share code, notes, and snippets.

@michaellearntorock2022
Forked from jadeallencook/instalike.js
Created May 10, 2022 04:53
Show Gist options
  • Select an option

  • Save michaellearntorock2022/7d2d861834bef4a3137225285cfcd88a to your computer and use it in GitHub Desktop.

Select an option

Save michaellearntorock2022/7d2d861834bef4a3137225285cfcd88a to your computer and use it in GitHub Desktop.
Script to auto like posts on Instagram.
// orginal script
// let likes = 0;
// setInterval(() => {
// const heart = document.querySelector('svg[aria-label="Like"]').parentNode;
// const arrow = document.querySelector('a.coreSpriteRightPaginationArrow');
// if (heart) {
// heart.click()
// likes++;
// console.log(`You've liked ${likes} post(s)`);
// }
// arrow.click();
// }, 5000);
// new script
let likes = 0;
setInterval(() => {
const heart = document.querySelector('svg[aria-label="Like"][width="24"]');
const arrow = document.querySelector('svg[aria-label="Next"]');
if (heart) {
heart.parentNode.parentElement.click()
likes++;
console.log(`You've liked ${likes} post(s)`);
}
arrow.parentElement.parentElement.click();
}, 20000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment