Code patched
The code has been patched yet again. This time, they decided to get rid of easy indicators of the like button. Below is working code (for now):
var buttons = document.getElementsByTagName('button'); var button = () => { var butt = null; var seen = 0; for (const button of buttons) { const props = button['__reactProps$zagytlsl8m']; if (props != undefined && props.className != undefined && props.className.includes('like')) { if (seen != 0){ butt = button; break; } seen += 1; } } return butt; } setInterval(function(){ button().click(); }, 1000)
Note that the props variable needs to change after every page refresh. This is because the code after reactProps$ changes with every page reload. Therefore, run the following code first:
console.log(document.getElementsByTagName('button'));
This will print an array of buttons. Click on any button in this array and copy the code after reactProps$ into the props variable. Then you can run the code above.
For those interested, the reason we are using a "seen" variable is because the super like always comes before the like in the buttons array. So we simply use the seen variable to skip the super like.
Cleaned the code up a bit and modified it so that it is a run and done. No need to console.log anything anymore; just run this and have fun swiping:
var buttons = document.getElementsByTagName('button'); var reactProps; for (key of Object.keys(buttons[0])) { if (key.split('$')[0] == '__reactProps') { reactProps = key; break; } } var button = () => { var likeButton = null; var seen = false; for (const button of buttons) { const props = button[reactProps]; if (props?.className && props.className.includes('like')) { if (seen){ likeButton = button; break; } seen = true; } } return likeButton; } setInterval(function(){ button().click(); }, 1000)