Skip to content

Instantly share code, notes, and snippets.

@zone0119
Last active February 27, 2024 16:30
Show Gist options
  • Save zone0119/0034dd278926065925ec5e26743b5de0 to your computer and use it in GitHub Desktop.
Save zone0119/0034dd278926065925ec5e26743b5de0 to your computer and use it in GitHub Desktop.
instalike.js
//Open GOOGLE press F12 -> put CODE to console, open insta POST
var countL = 0;
if (location.href == 'https://www.instagram.com/')
{
function mF() {
var minSec = 3,
maxSec = 7;
var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 3 - 7
var likes = document.querySelectorAll('._aamw');
for (var i = 0; i < likes.length; i++) {
likes[i].querySelector("div[role='button']").click();
countL++
}
console.log("countL=" + countL);
window.scrollBy(0, 550);
setTimeout(mF, rand * 1000);
}
mF();
}
else
{
var count = 1;
function f() {
let like = document.getElementsByClassName('_aamw');
console.log(like[0]);
like[0].querySelector("div[role='button']").click();
countL++
var minSec = 6,
maxSec = 20;
var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 5 - 10
console.log('Wait for ' + rand + ' seconds');
var next = document.querySelector('._aaqg');
next.querySelector('button').click();
console.log(count + " - next" + next);
delete next;
console.log("countL=" + countL);
setTimeout(f, rand * 1000);
}
f()
}
@DaycareJr
Copy link

Good timezone! this thing worked great for a long time! but now its pushing out this error..

Uncaught TypeError: Cannot read properties of null (reading 'click')
at f (:44:32)
at :60:4

@zone0119
Copy link
Author

zone0119 commented Jun 28, 2023

Good day! Glad to hear that someone is using the code and is helpful! I'll try to take a look over the weekend!

@zone0119
Copy link
Author

zone0119 commented Jul 12, 2023

//Open GOOGLE press F12 -> put CODE to console, open insta POST

// 130723 they changed the address attribute like[0].querySelector("div[role='button']").click();

var countL = 0;

if (location.href == 'https://www.instagram.com/')
{

		function mF() {

		  var minSec = 3,
		  maxSec = 7;
		  var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 3 - 7

var likes = document.querySelectorAll('._aamw');

for (var i = 0; i < likes.length; i++) {

likes[i].querySelector("div[role='button']").click();
countL++

}

console.log("countL=" + countL);

		 window.scrollBy(0, 550);

setTimeout(mF, rand * 1000);
}
mF();

}
else
{

		var count = 1;
		function f() {	

let like = document.getElementsByClassName('_aamw');
console.log(like[0]);
like[0].querySelector("div[role='button']").click();
countL++
var minSec = 6,
maxSec = 20;
var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 5 - 10
console.log('Wait for ' + rand + ' seconds');
var next = document.querySelector('._aaqg');
next.querySelector('button').click();
console.log(count + " - next" + next);
delete next;

console.log("countL=" + countL);
setTimeout(f, rand * 1000);
}

		f()

}

@zone0119
Copy link
Author

zone0119 commented Jul 12, 2023

I am very glad that someone uses my code in this world

Hello here is new code

subscribe if it's not difficult for you

@zone0119
Copy link
Author

// only like comment
//this code only likes comments, if you need posts then above code works

//Open GOOGLE press F12 -> put CODE to console, open insta POST

// 130723 they changed the address attribute like[0].querySelector("div[role='button']").click();

var countL = 0;

if (location.href == 'https://www.instagram.com/')
{

		function mF() {

		  var minSec = 3,
		  maxSec = 7;
		  var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 3 - 7

var likes = document.querySelectorAll('._aamf');

for (var i = 0; i < likes.length; i++) {

likes[i].querySelector("div[role='button']").click();
countL++

}

console.log("countL=" + countL);

		 window.scrollBy(0, 550);

setTimeout(mF, rand * 1000);
}
mF();

}
else
{

		var count = 1;
		function f() {	

let like = document.getElementsByClassName('_aamf');
console.log(like[0]);
like[0].querySelector("div[role='button']").click();
countL++
var minSec = 6,
maxSec = 20;
var rand = Math.floor(Math.random() * (maxSec - minSec + 1) + minSec); //Generate Random number between 5 - 10
console.log('Wait for ' + rand + ' seconds');
var next = document.querySelector('._aaqg');
next.querySelector('button').click();
console.log(count + " - next" + next);
delete next;

console.log("countL=" + countL);
setTimeout(f, rand * 1000);
}

		f()

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment