您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Find similar elements and append their rank by watch number in descending order.
当前为
// ==UserScript== // @name Append Rank by WatchNumber/LikeNumber in the Suno.ai Single Page // @namespace http://tampermonkey.net/ // @version 1.0.2 // @description Find similar elements and append their rank by watch number in descending order. // @author aspen138 // @match *://app.suno.ai/* // @icon https://www.google.com/s2/favicons?sz=64&domain=suno.ai // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to append rankings based on text content numbers function appendRankings(selector) { window.addEventListener('load', function() { // Find elements matching the selector and convert NodeList to Array const elements = Array.from(document.querySelectorAll(selector)); console.log("elements=", elements); // Filter, sort, and append rank in a combined step elements .filter(el => el.querySelector('p')) // Filter elements containing a <p> tag .sort((a, b) => { // Sort elements by the number inside <p> in descending order const aNumber = parseInt(a.querySelector('p').textContent, 10); const bNumber = parseInt(b.querySelector('p').textContent, 10); return bNumber - aNumber; }) .forEach((element, index) => { // Append a rank span to each element const rankDisplay = document.createElement('span'); rankDisplay.style.marginLeft = '10px'; rankDisplay.textContent = `Rank${index + 1}'`; rankDisplay.className="chakra-text css-19h91tu"; element.appendChild(rankDisplay); }); console.log("sortedElements", elements); // Debugging }); } // Call the function for both selectors appendRankings('button[data-theme="dark"][aria-label="Play Count"].css-1v0yma7'); appendRankings('button[data-theme="dark"][aria-label="like-button"]'); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址