List liker

Installing this scrolls and likes all posts on the match page

目前為 2021-05-31 提交的版本,檢視 最新版本

// ==UserScript==
// @name         List liker
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Installing this scrolls and likes all posts on the match page
// @author       You
// @match        https://twitter.com/i/lists/1390432068866281476
// @icon         https://www.google.com/s2/favicons?domain=twitter.com
// @grant        none
// ==/UserScript==

(function () {
  setTimeout(() => {
    'use strict';

    const fireEvent = (el, etype) => {
      var evObj = document.createEvent('Events');
      evObj.initEvent(etype, true, false);
      el.dispatchEvent(evObj);
    }
    const random = (min, max) => Math.random() * (max - min) + min;
    const getHearts = () => Array.from(document.querySelectorAll('[d="M12 21.638h-.014C9.403 21.59 1.95 14.856 1.95 8.478c0-3.064 2.525-5.754 5.403-5.754 2.29 0 3.83 1.58 4.646 2.73.814-1.148 2.354-2.73 4.645-2.73 2.88 0 5.404 2.69 5.404 5.755 0 6.376-7.454 13.11-10.037 13.157H12zM7.354 4.225c-2.08 0-3.903 1.988-3.903 4.255 0 5.74 7.034 11.596 8.55 11.658 1.518-.062 8.55-5.917 8.55-11.658 0-2.267-1.823-4.255-3.903-4.255-2.528 0-3.94 2.936-3.952 2.965-.23.562-1.156.562-1.387 0-.014-.03-1.425-2.965-3.954-2.965z"]'))
    const clickHeart = (h) => setTimeout(() => fireEvent(h, 'click'), random(500, 3000));
    const maxTop = 20000;
    const scrollAmt = 2000;

    let top = 0;

    setInterval(() => {
      top = top < maxTop ? top + scrollAmt : 0;

      window.scrollTo({ top, behavior: 'smooth' });

      setTimeout(() => getHearts().forEach(clickHeart), random(300, 1300));
    }, random(9000, 13000));
  }, 3000)
})();

QingJ © 2025

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