4 min to read
How to like Instagram posts with JavaScript?
ye Aaram ka Mamala hai !
Before starting let’s recall what JavaScript is and How it works ?
JavaScript is a scripting or programming language that allows us to implement complex features on web pages.
JavaScript is a scripting language that enables us to create dynamically updating content,control multimedia,animate images and pretty much everything else.
JavaScript is both client side and server side language. Like node.js could be used on server side and vanilla Js for client side .
In this process we’ll use JavaScript Client side behaviour to execute our script in browser .
This script will use execute itself in client side browser and automatically like the instagram posts.
Prerequisite
- Instagram account
- Instagram WebApp
- Browser eg- chrome, edge,mozilla
- Basic understanding of Js
Steps :-
- Login to instagram account via instagram WebApp
- select the profile or # tags whose post you have to like
- Inspect the webpage either by Ctrl+Shift+I / cmd+Shift+I (Mac)
- Use arrow function and DOM querySelector () Method
-
Build your own logic or take reference from sample code given below
Don’t forget to put Time interval for delay, else Instagram might consider script as Bot and your account might be suspended !
code
let likesGiven = 0;
setInterval(() => {
let heart = document.querySelector('button.wpO6b'),
arrow = document.querySelector('.coreSpriteRightPaginationArrow');
if (heart) {
likesGiven++;
heart.click();
}
arrow.click();
console.log(`You've liked ${likesGiven} post(s)!`);
}, 2000);
Sample Video
Comments