您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove items with less than 1000 followers or rating less than 4.5
// ==UserScript== // @name Remove Not enough followers // @namespace http://royalroad.com/ // @version 1.1 // @description Remove items with less than 1000 followers or rating less than 4.5 // @match *://www.royalroad.com/fictions/rising-stars // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function removeLowQualityItems() { console.log("Removing < 1000 followers and < 4.5 rating item"); var items = $(".fiction-list-item.row"); items.each(function() { var followersText = $(this).find('.fa-users').next('span').text(); var followers = parseInt(followersText.replace(/[^0-9]/g, ''), 10); var ratingText = $(this).find('.fa-star').next('span').attr('title'); var rating = parseFloat(ratingText); if (followers < 1000 || rating < 4.5) { $(this).remove(); } }); } function waitForElements(selector, callback) { var elements = $(selector); if (elements.length) { callback(); } else { console.log("Waiting for elements:", selector); setTimeout(function() { waitForElements(selector, callback); }, 100); } } $(document).ready(function() { waitForElements('.fiction-list-item.row', removeLowQualityItems); }); })();