Spotify Wrapped Farming

Automatically skip songs on Spotify Web Player after a random interval between 75 to 90 seconds, then repeat.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Spotify Wrapped Farming
// @namespace    https://greasyfork.org/en/users/1464319
// @version      2025.05.01
// @description  Automatically skip songs on Spotify Web Player after a random interval between 75 to 90 seconds, then repeat.
// @author       Lin808
// @match        https://open.spotify.com/*
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function getRandomInt(min, max) {
        min = Math.ceil(min);
        max = Math.floor(max);
        return Math.floor(Math.random() * (max - min) + min);
    }

    function doSkip() {
        // Spotify "Next" button usually has aria-label="Next"
        var button = document.querySelector('button[aria-label="Next"]');
        if(button) {
            button.click();
            console.log('Skipped song at', new Date().toLocaleTimeString());
        } else {
            console.log('Next button not found');
        }
    }

    (function loop() {
        var rand = getRandomInt(75000, 90000);
        console.log('Next skip in (ms):', rand);
        setTimeout(function() {
            doSkip();
            loop();
        }, rand);
    }());

})();