Oproot. Learn all that is learnable.

Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Instagram bot: Hacking around with Javascript  (Read 658 times)

codeReview

  • Newbie
  • *
  • Posts: 8
    • View Profile
Instagram bot: Hacking around with Javascript
« on: April 15, 2018, 11:47:50 pm »

Here is a process with some Javascript code that I was able to use to automate surfing Instagram and auto-liking posts.

Warning: Probably not approved by Instagram.

With Chrome..
1. Logged into Instagram account (@oproot).
2. Performed search on a hashtag (example: #ATX or #picoftheday).
3. Clicked on a picture.
4. In the browser, selected Options.. More tools.. Developer tools.. Console.
5. Entered the following code in the console and hit Enter.

Code: [Select]
function getHeartElement() {
    var knownHeartElementNames = ["coreSpriteHeartOpen", "coreSpriteLikeHeartOpen"];
    var i = 0;
    // Loop through the known heart elements until one works
    for (i = 0; i < knownHeartElementNames.length; i++) {
        var heartElement = document.querySelector('.' + knownHeartElementNames[i]);
        if (heartElement != undefined) {
            break;
        }
    }
    return heartElement;
}
function doLike() {
    var likeElement = getHeartElement();
    var nextElement = document.querySelector('.coreSpriteRightPaginationArrow');
    likeCount++;
    console.log('Liked ' + likeCount);
    var nextTime = Math.random() * (14000 - 4000) + 4000;
    likeElement.click();
    setTimeout(function() {nextElement.click();}, 1000);
    if (likeCount < 25) {
        setTimeout(doLike, nextTime);
    } else {
        console.log('Break time..');
    }
}
var likeCount = 0;
doLike();
« Last Edit: April 15, 2018, 11:57:34 pm by codeReview »
Logged

codeReview

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Instagram bot: Hacking around with Javascript
« Reply #1 on: April 16, 2018, 12:03:55 am »

One other note... there's a max on there of 25 to give you a chance to try it out.

The 25 can be increased or decreased to a different number.
Logged

codeReview

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Instagram bot: Hacking around with Javascript
« Reply #2 on: April 25, 2018, 09:31:31 am »

Result: 75 followers in 10 days (some real, some fake)
Logged