InstaBot

try to take over the world!

目前為 2020-02-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         InstaBot
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @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 heartsLike = Array.from(document.querySelectorAll('[aria-label="Like"]') || []);
    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);
    });
  }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址