Javascript to automatically put likes on a tag on instagram.

I made and modified a script that I found on the internets that automatically puts likes on a tag on instagram when you are using a web browser.

It’s a little complicated, but also not that complicated.

Open chrome
Navigate to instagram.com
Be logged in
Type a search tag.
Open the first image you like.
then rightclick, chose inspect.
Find the “console”
Take the script I’ve added to this page and poaste it there (modify for english isntagram)
and press enter.

Viola, it will like and like and like

var likeCount =0;
 function loop()
 {
 	console.log('Script loading…please wait…');
 	var Time1 = Math.ceil(Math.random() * 10) + 3;
 	var Time2 = Math.ceil(Math.random() * 10) + 3;
 	var randomSkip =  Math.random() * 10;

 	setTimeout(function ()
 	{
 	 //Unlike

 		if (document.querySelectorAll('svg[aria-label="Sluta Gilla"]')[0]) 
 		{
 			console.log('Already Liked');
 		}
 		else if(parseInt(randomSkip) >=8 ) //we skip some of the post, we dont want to be a heart sleuth
 		{
			console.log('Random Skipping: ' + parseInt(randomSkip) );
 		}
 		else
 		{
 			likeCount++;
 			console.log('Liking the post');
 			 //Like
 			var btn = document.querySelectorAll('svg[aria-label="Gilla"]');
 			btn[0].parentElement.click();
 		}
 		setTimeout(function ()
 		{
 			if (document.querySelectorAll('a.coreSpriteRightPaginationArrow').length)
 			{
 				console.log('Loading next post');
 				console.log('Totally liked : '+likeCount);
 				var btn = document.querySelectorAll('a.coreSpriteRightPaginationArrow');
 				btn[0].click();
 			}
 			else
 			{
 				console.log('No more posts on this tag!');
 			}
 			loop();
 		}, Time1 * 1000);
 	}, Time2 * 1000);
 }
 loop();

Leave a Reply