1. 程式人生 > >油猴指令碼(tampermonkey):百度網盤搜尋引擎聚合

油猴指令碼(tampermonkey):百度網盤搜尋引擎聚合

首先安裝油猴指令碼(tampermonkey)
chrome:【油猴指令碼(tampermonkey)外掛】。chrome或者其他瀏覽器也可以去【油猴指令碼(tampermonkey)官網】下載。

程式碼首先在greasyfork上的分享

其次在吾愛油猴上的分享

再在guihub上的分享

最後我直接貼上程式碼:

  1 // ==UserScript==
  2 // @name         百度網盤搜尋引擎聚合
  3 // @version      1.4
  4 // @description  在百度雲盤頁面中新增百度網盤搜尋引擎聚合
  5 // @match        *://pan.baidu.com/*
6 // @match *://yun.baidu.com/* 7 // @grant 來自各個網盤搜尋引擎開發者 8 // @author 太史子義慈 9 // @namespace [email protected] 10 // ==/UserScript== 11 12 !(function() { 13 bseg(); 14 })(); 15 16 function bseg() { 17 //確定顯示點是否存在 18 if(document.querySelector(".find-light-icon") !== null
|| document.querySelector("#hgejgNaM") !== null) { 19 20 //搜尋引擎網址目錄,%sv%為替換符 21 var dirall = { 22 "id_opt_00": { 23 0: "愛搜資源", 24 1: "https://www.aisouziyuan.com/?name=%sv%", 25 }, 26 "id_opt_01": { 27 0: "雲盤精靈",
28 1: "https://www.yunpanjingling.com/search/%sv%", 29 }, 30 "id_opt_02": { 31 0: "雲盤惡魔a", 32 1: "https://yunpanem.com/search/a/%sv%/1.html", 33 }, 34 "id_opt_03": { 35 0: "雲盤惡魔c", 36 1: "https://yunpanem.com/search/c/%sv%/1.html", 37 }, 38 "id_opt_04": { 39 0: "雲盤惡魔f", 40 1: "https://yunpanem.com/search/f/%sv%/1.html", 41 }, 42 "id_opt_05": { 43 0: "磁力貓", 44 1: "https://www.cilimao.me/search?word=%sv%", 45 }, 46 "id_opt_06": { 47 0: "小不點搜尋", 48 1: "https://www.xiaobd.net/m/search?wd=%sv%", 49 }, 50 "id_opt_07": { 51 0: "胖次搜尋", 52 1: "https://www.panc.cc/s/%sv%/td_0", 53 }, 54 "id_opt_08": { 55 0: "去轉盤", 56 1: "http://www.quzhuanpan.com/source/search.action?q=%sv%", 57 }, 58 "id_opt_09": { 59 0: "天天雲搜", 60 1: "https://www.ttyunsou.com/s?keyword=%sv%", 61 }, 62 "id_opt_10": { 63 0: "豬豬盤1", 64 1: "http://www.zhuzhupan.com/search?s=1&query=%sv%", 65 }, 66 "id_opt_11": { 67 0: "豬豬盤2", 68 1: "http://www.zhuzhupan.com/search?s=2&query=%sv%", 69 }, 70 "id_opt_12": { 71 0: "豬豬盤3", 72 1: "http://www.zhuzhupan.com/search?s=3&query=%sv%", 73 }, 74 "id_opt_13": { 75 0: "豬豬盤4", 76 1: "http://www.zhuzhupan.com/search?s=4&query=%sv%", 77 }, 78 "id_opt_14": { 79 0: "豬豬盤5", 80 1: "http://www.zhuzhupan.com/search?s=5&query=%sv%", 81 }, 82 "id_opt_15": { 83 0: "豬豬盤6", 84 1: "http://www.zhuzhupan.com/search?s=6&query=%sv%", 85 }, 86 "id_opt_16": { 87 0: "豬豬盤7", 88 1: "http://www.zhuzhupan.com/search?s=7&query=%sv%", 89 }, 90 "id_opt_17": { 91 0: "豬豬盤8", 92 1: "http://www.zhuzhupan.com/search?s=8&query=%sv%", 93 }, 94 "id_opt_18": { 95 0: "豬豬盤匯流排", 96 1: "http://www.zhuzhupan.com/search?s=100&query=%sv%", 97 }, 98 "id_opt_19": { 99 0: "雲搜全量", 100 1: "http://www.daysou.com/s?q=%sv%&start=0&isget=1&tp=all&cl=0&line=4", 101 }, 102 "id_opt_20": { 103 0: "雲搜加密", 104 1: "http://www.daysou.com/s?q=%sv%&start=0&isget=1&tp=all&cl=0&line=3", 105 }, 106 "id_opt_21": { 107 0: "雲搜引擎1", 108 1: "http://www.daysou.com/s?q=%sv%&start=0&isget=1&tp=all&cl=0&line=0", 109 }, 110 "id_opt_22": { 111 0: "雲搜引擎3", 112 1: "http://www.daysou.com/s?q=%sv%&start=0&isget=1&tp=all&cl=0&line=2", 113 }, 114 "id_opt_23": { 115 0: "雲搜引擎2", 116 1: "http://www.daysou.com/s?q=%sv%&start=0&isget=1&tp=all&cl=0&line=1", 117 }, 118 "id_opt_24": { 119 0: "網盤007", 120 1: "https://wangpan007.com/share/kw%sv%", 121 }, 122 "id_opt_25": { 123 0: "鴕鳥搜尋", 124 1: "http://www.tuoniao.me/search/%sv%/list", 125 }, 126 "id_opt_26": { 127 0: "盤找找", 128 1: "http://www.13910.com/s/?kw=%sv%", 129 }, 130 "id_opt_27": { 131 0: "搜雲盤", 132 1: "http://www.soyunpan.com/search/%sv%-0-全部-0.html", 133 }, 134 "id_opt_28": { 135 0: "verypan", 136 1: "http://www.verypan.com/index/index/baidusearch?keyword=%sv%", 137 }, 138 "id_opt_29": { 139 0: "西林街搜尋", 140 1: "http://www.xilinjie.com/s?q=%sv%&t=pan", 141 }, 142 "id_opt_30": { 143 0: "小白盤", 144 1: "http://www.xiaobaipan.com/list-%svh%", 145 }, 146 "id_opt_31": { 147 0: "盤多多", 148 1: "http://www.panduoduo.net/s/name/%sv%", 149 }, 150 "id_opt_32": { 151 0: "圖書盤", 152 1: "http://www.tushupan.com/search?query=%sv%", 153 }, 154 "id_opt_33": { 155 0: "史萊姆搜尋", 156 1: "http://www.slimego.cn/search.html?q=%sv%", 157 }, 158 "id_opt_34": { 159 0: "雲鋪子", 160 1: "http://www.yunpuzi.net/all/s-%sv%.html", 161 }, 162 "id_opt_35": { 163 0: "sola資源站", 164 1: "http://www.3134.cc/search.php?kw=%sv%", 165 }, 166 "id_opt_36": { 167 0: "盤115", 168 1: "http://www.guanggua.com/search?key=%sv%", 169 }, 170 "id_opt_37": { 171 0: "58網盤", 172 1: "http://www.58wangpan.com/search/kw%sv%", 173 }, 174 "id_opt_38": { 175 0: "56網盤", 176 1: "http://www.56wangpan.com/search/kw%sv%", 177 }, 178 "id_opt_39": { 179 0: "58網盤2", 180 1: "http://wx01.51caichang.com/so?keyword=%sv%", 181 }, 182 "id_opt_40": { 183 0: "我的盤", 184 1: "http://www.wodepan.com/list/%sv%-1.html", 185 }, 186 "id_opt_41": { 187 0: "及搜盤", 188 1: "http://www.jisoupan.com/search/%sv%.html", 189 }, 190 "id_opt_42": { 191 0: "哎呦喂啊", 192 1: "http://www.aiyoweia.com/search/%sv%", 193 }, 194 "id_opt_43": { 195 0: "愛挖盤", 196 1: "http://www.iwapan.com/so.aspx?wd=%sv%", 197 }, 198 "id_opt_44": { 199 0: "盤搜", 200 1: "http://www.pansou.com/?q=%sv%", 201 }, 202 "id_opt_45": { 203 0: "雲搜一下", 204 1: "http://sou.wolfbe.com/s?q=%sv%", 205 }, 206 "id_opt_46": { 207 0: "麥庫搜尋", 208 1: "http://www.huisou.me/index.php?k=%sv%", 209 }, 210 "id_opt_47": { 211 0: "探索雲盤", 212 1: "http://tansuo233.com/?search=%sv%", 213 }, 214 "id_opt_48": { 215 0: "坑搜網", 216 1: "http://www.kengso.com/s?wd=%sv%", 217 }, 218 "id_opt_49": { 219 0: "喵搜", 220 1: "https://nyaso.com/dong/%sv%.html", 221 }, 222 "id_opt_50": { 223 0: "西邊雲", 224 1: "http://www.xibianyun.com/wp/search?q=%sv%", 225 }, 226 "id_opt_51": { 227 0: "網盤搜尋BT", 228 1: "http://www.sosobta.cn/search/%sv%", 229 }, 230 "id_opt_52": { 231 0: "百度盤資源", 232 1: "http://www.friok.com/?s=%sv%", 233 }, 234 "id_opt_53": { 235 0: "325搜", 236 1: "http://pan.here325.com/s?q=%sv%", 237 }, 238 "id_opt_54": { 239 0: "6miu", 240 1: "http://baiduyun.6miu.com/word.html?kw=%sv%", 241 }, 242 "id_opt_55": { 243 0: "90網盤", 244 1: "https://pan.90xz.com/search/%sv%", 245 }, 246 "id_opt_56": { 247 0: "fastsoso", 248 1: "https://www.fastsoso.cn/search?k=%sv%", 249 }, 250 "id_opt_57": { 251 0: "v搜尋", 252 1: "http://www.v1248.com/index.htm?kw=%sv%", 253 }, 254 "id_opt_58": { 255 0: "搜盤", 256 1: "http://www.soupan.info/search.php?q=%sv%", 257 }, 258 "id_opt_59": { 259 0: "特多盤", 260 1: "http://so.hzbslp.com/api.php?pn=1&sr=%sv%", 261 }, 262 "id_opt_60": { 263 0: "網盤資源網", 264 1: "http://www.0933.me/search.html?wd=%sv%", 265 }, 266 "id_opt_61": { 267 0: "百度網盤搜", 268 1: "https://www.xalssy.com.cn/search/kw%sv%", 269 }, 270 "id_opt_62": { 271 0: "特百度", 272 1: "http://www.tebaidu.com/search.asp?wd=%sv%", 273 }, 274 "id_opt_63": { 275 0: "搜搜雲盤", 276 1: "http://www.sosoyunpan.com/search.asp?wd=%sv%", 277 }, 278 "id_opt_64": { 279 0: "雲網盤之家", 280 1: "http://www.wowenda.com/search?wd=%sv%", 281 }, 282 "id_opt_65": { 283 0: "盤優搜", 284 1: "http://www.panuso.com/s/%sv%.html", 285 }, 286 "id_opt_66": { 287 0: "麥庫搜尋", 288 1: "http://huisou.me/index.php?k=%sv%", 289 }, 290 "id_opt_67": { 291 0: "網盤傳奇", 292 1: "https://www.jidanso.com/index.php/search/?q=%sv%", 293 }, 294 "id_opt_68": { 295 0: "SoV5", 296 1: "https://www.sov5.cn/search?q=%sv%", 297 }, 298 "id_opt_69": { 299 0: "下載搜", 300 1: "https://www.xiazaisou.com/wangpan?s=%sv%", 301 }, 302 "id_opt_70": { 303 0: "優質吧", 304 1: "http://uzi8.cn/search/kw%sv%", 305 }, 306 "id_opt_71": { 307 0: "網盤之家", 308 1: "http://www.wangpanzhijia.net/search.html?wd=%sv%", 309 }, 310 "id_opt_72": { 311 0: "眾人搜網盤", 312 1: "http://wangpan.renrensousuo.com/jieguo?sa=網盤搜尋&q=%sv%", 313 }, 314 "id_opt_73": { 315 0: "樂依分享", 316 1: "https://www.dyroy.com/html/search.html?q=%sv%", 317 }, 318 319 }; 320 321 //找到父親節點 322 var father = document.getElementsByClassName("vyQHNyb")[0]; 323 var father2 = document.getElementsByClassName("pickpw")[0]; 324 325 //新建span子節點 326 var new_span = document.createElement('span'); 327 new_span.setAttribute("id", "id_new_span"); 328 if(father) { 329 father.appendChild(new_span); 330 } else if(father2) { 331 father2.appendChild(new_span); 332 } 333 334 //span節點再建【選擇框】子節點 335 var new_select = document.createElement('select'); 336 new_span.appendChild(new_select); 337 if(father) { 338 new_select.style.cssText = "font-size: 15px;height: 30px;color: black;"; 339 } else if(father2) { 340 new_select.style.cssText = "font-size: 15px;height: 30px;color: black;display:inline-block;margin:5px 0 0 0;"; 341 } 342 343 //選擇框子節點下面要建立大量【選項】子節點 344 for(var i in dirall) { 345 var v = dirall[i][0]; 346 new_option(v, i, new_select); 347 } 348 349 //span節點再建【輸入框】子節點 350 var new_input = document.createElement('input'); 351 new_input.setAttribute("id", "scont"); 352 new_input.setAttribute("class", "scont"); 353 new_input.setAttribute("placeholder", "請輸入要搜尋的內容"); 354 new_span.appendChild(new_input); 355 if(father) { 356 new_input.style.cssText = "font-size:15px;width:180px;height: 22px;color:black;padding:2px;"; 357 new_input.focus(); 358 } else if(father2) { 359 new_input.style.cssText = "font-size:15px;width:231px;height: 22px;color:black;padding:2px;"; 360 } 361 362 //span節點再建【按鈕】子節點 363 var new_btn = document.createElement('button'); 364 new_btn.innerHTML = "搜尋"; 365 new_span.appendChild(new_btn); 366 new_btn.style.cssText = "font-size: 14px;width: 52px;height: 29px;color: black;"; 367 368 //按鈕點選事件 369 new_btn.onclick = function() { 370 //獲得輸入框資料 371 var new_input_val = new_input.value; 372 //計算輸入框資料長度 373 var new_input_val_len = new_input_val.length; 374 //如果輸入框有資料 375 if(new_input_val_len > 0) { 376 //獲得選擇框裡被選中的選項索引 377 var option_index = new_select.selectedIndex; 378 //根據索引獲得獲得選擇框裡被選中的選項id 379 var option_select_id = new_select.options[option_index].id; 380 //根據id和網址目錄獲得網址 381 var pcsearch = dirall[option_select_id][1]; 382 //用輸入框的資料替換掉網址內的替換符 383 var dti = pcsearch.replace("%sv%", new_input_val); 384 //網址跳轉 385 window.open(dti); 386 } else { 387 alert("請在前面的輸入框輸入要搜尋的內容。"); 388 new_input.focus(); 389 } 390 } 391 392 //清除廣告,騰位置 393 var zzy = father.childNodes[2]; 394 zzy.style.cssText = "display: none!important;"; 395 } else { 396 console.log("失敗一次"); 397 //顯示點不存在,50毫秒後再次執行 398 setTimeout(function() { 399 bseg(); 400 }, 50); 401 } 402 403 //新建option 404 function new_option(ih, aid, ns) { 405 var new_opt = document.createElement('option'); 406 new_opt.innerHTML = ih; 407 new_opt.setAttribute("id", aid); 408 ns.appendChild(new_opt); 409 } 410 }