您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Clicks "like" button when sees it. Just scroll the page as you usually do.
// ==UserScript== // @name InstagramPostsLiker // @namespace http://tampermonkey.net/ // @version 0.1.2 // @description Clicks "like" button when sees it. Just scroll the page as you usually do. // @author goodwin64 // @match https://www.instagram.com/* // @grant none // ==/UserScript== (function() { 'use strict'; console.debug('InstaBot start'); setInterval(likePosts, 100); const defaultElement = document.createElement('div'); function likePosts() { const likeSelectors = ['Like', 'Подобається'] .map(word => `[aria-label="${word}"][width="24"]`) .join(','); const heartsLike = Array.from(document.querySelectorAll(likeSelectors) || []); heartsLike.forEach((h, index) => { setTimeout(() => { const articleParentElement = h.closest('article') || defaultElement; const usernameElement = articleParentElement.querySelector('a.notranslate'); if (usernameElement) { console.log('like:', usernameElement.innerText); } if (h && h.parentElement) { h.parentElement.click(); } }, index * 5000); }); } })();