Last active
May 22, 2019 10:16
-
-
Save fredsiika/ee0e07215e6655570c0399519d893205 to your computer and use it in GitHub Desktop.
Scripts that generate auto likes on Instagram posts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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