Greasy Fork

Greasy Fork is available in English.

soundcloud autoplay

Does autoplay first track of given category

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        soundcloud autoplay
// @author      erm3nda at gmail.com
// @author-www  http://tronko.es
// @namespace   souncloud-autoplay
// @icon        http://files.softicons.com/download/social-media-icons/simple-icons-by-dan-leech/png/32x32/soundcloud.png
// @description Does autoplay first track of given category
// @include     https://soundcloud.com/*
// @include     https://soundcloud.com/charts/top/*
// @version     1.0.1
// @grant       none
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// ==/UserScript==

//~ var category = "" // set blank for trending-music
var category="electronic"
var url_cat="?genre=" + category
// var category="alternative+rock"

$( document ).ready(function() {
    console.log( "ready!" );
    if (document.URL == "https://soundcloud.com/stream") {
        window.location.href = "https://soundcloud.com/charts/top" + url_cat
        }
    
    if (document.URL == "https://soundcloud.com/charts/top" + url_cat) {
        setTimeout(function() {
            buttons = document.getElementsByClassName("sc-button-play")
            play = buttons[0]
            play.click()
            console.log("Playing ...")
            }, 5000)
        }    

});