您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Searches for torrents with the same name as the current one
// ==UserScript== // @name HDBits torrent search // @namespace https://greasyfork.org/users/19952-xant1k-bt // @description Searches for torrents with the same name as the current one // @include https://hdbits.org/details.php?id=* // @version 1.0 // @author deva // ==/UserScript== title = document.getElementsByTagName('h1')[0]; titleString = new String(title.innerHTML); searchLink = document.createElement('a'); searchLink.innerHTML = 'search on HDBits'; if(titleString.match(/s[0-9][0-9]e[0-9][0-9]/i) != null){// show titleString = titleString.match(/^(.*?)( -)? s[0-9][0-9]e[0-9][0-9]/i)[1]; }else if(titleString.match(/ - /i) != null){ titleString = titleString.match(/^(.*?) - /i)[1]; }// else just use original string searchLink.href='browse.php?search='+titleString; searchLink.title = 'search HDBits for "' + titleString + '"'; table = myNextSibling(title); tbody = myFirstChild(table); linkTD = tbody.firstChild.firstChild.nextSibling; linkTD.appendChild(document.createTextNode(' | ')); linkTD.appendChild(searchLink); // helping functions function myFirstChild(obj){ temp = obj.firstChild; while(temp.nodeType == 3){ //TEXT_NODE = 3 temp = temp.nextSibling; } return temp; } function myNextSibling(obj){ temp = obj.nextSibling; while(temp.nodeType == 3){ //TEXT_NODE = 3 temp = temp.nextSibling; } return temp; }