Skip to content

Instantly share code, notes, and snippets.

@fredsiika
Last active May 22, 2019 10:16
Show Gist options
  • Save fredsiika/ee0e07215e6655570c0399519d893205 to your computer and use it in GitHub Desktop.
Save fredsiika/ee0e07215e6655570c0399519d893205 to your computer and use it in GitHub Desktop.
Scripts that generate auto likes on Instagram posts.
/**
* setInterval(); takes a function and time interval
* which is set to 10 seconds to avoid the Instagram
* from banning the account.
**/
/* Step 1: Determine which elements control `hearts` & `clicks`. */
// var heart = document.querySelector('button.afkep');
// var arrow = document.querySelector('a.coreSpriteRightPaginationArrow');
/* Step 2: Wrap these new variables inside the setInterval();
setInterval(function() {
var heart = document.querySelector('button.afkep');
var arrow = document.querySelector('a.coreSpriteRightPaginationArrow');
}, 10000
*/
/* Step 3: Create a counter equal to zero before the function setInterval();
var count = 0;
*/
/* Step 5: Add `if` statement logic whenever a heart is clicked */
/* Final Result */
var count = 0;
setInterval(function() {
var heart = document.querySelector('button.afkep');
var arrow = document.querySelector('a.coreSpriteRightPaginationArrow');
if (heart) {
heart.click();
count++;
console.log(`You have liked ${count} photos`);
}
arrow.click();
}, 10000);
/**
* Written in ES6 and changed the value of the
* heart variable by replacing the `button.afkep`
* with `glyphsSpriteHeart__outline__24__grey_9`
**/
let likesGiven = 0;
setInterval(() => {
let heart = document.getElementsByClassName('glyphsSpriteHeart__outline__24__grey_9'),
arrow = document.querySelector('.coreSpriteRightPaginationArrow');
if (heart[1]) {
heart = heart[1].parentElement;
likesGiven++, heart.click();
}
arrow.click();
console.log(`You've liked ${likesGiven} post(s)!`);
}, 10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment