AO3 Filter Bookmarks By Length

Script to filter bookmarks based on word count. Edit min_len and max_len to taste.

目前為 2024-03-17 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         AO3 Filter Bookmarks By Length
// @namespace    https://greasyfork.org/en/users/296127-doleful-shades
// @version      0.1
// @description  Script to filter bookmarks based on word count. Edit min_len and max_len to taste.
// @author       dolefulshades
// @match      http://archiveofourown.org/*/bookmarks*
// @match      https://archiveofourown.org/*/bookmarks*
// @match      http://archiveofourown.org/bookmarks*
// @match      https://archiveofourown.org/bookmarks*
// @grant    none
// @license    MIT
// ==/UserScript==

// minimum length
var min_len = 0;

// maximum length
var max_len = Infinity;


(function($) {
    var works = $('.bookmarks-index .blurb:has(.stats)'); //all works
    var words = $(".bookmarks-index .blurb .stats dt:contains('Words:')"); //all "Words:" descriptors before word count
    //$(words).css('color', 'red');
    for(var i=0;i<$(works).length;i++){
        var len = $($(words)[i].nextElementSibling).text().replace(',',''); //get word count for each work
        //console.log(len);

        if (true && len < min_len||len > max_len) { //if the word count does not fall between min_len and max_len, hide the work
            //console.log('hid '+len);
            var work = $(works)[i];
            $(work).hide();
        }
    }

})(window.jQuery);