Greasy Fork镜像 支持简体中文。

复制百度文库

try to take over the world!

  1. // ==UserScript==
  2. // @name 复制百度文库
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description try to take over the world!
  6. // @author Jachin
  7. // @match http*://wenku.baidu.com/view/*
  8. // @grant unsafeWindow
  9. // @grant GM_setClipboard
  10. // @grant GM_notification
  11. // @grant GM_xmlhttpRequest
  12. // @grant GM_registerMenuCommand
  13. // @connect *
  14. // @require https://gf.qytechs.cn/scripts/420118-cycle/code/Cycle.js
  15. // @require https://gf.qytechs.cn/scripts/420119-utils-lib/code/Utils-lib.js
  16. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js
  17. // ==/UserScript==
  18.  
  19. unsafeWindow.GM_xmlhttpRequest = GM_xmlhttpRequest;
  20. unsafeWindow.GM_setClipboard = GM_setClipboard;
  21.  
  22. function exportObj(obj){
  23. let out = document.title.replace(/\||<|>|\?|\*|:|\/|\\|"|\n/g, ' ') + ".json";
  24. let data = JSON.stringify(JSON.decycle(obj), null, 4);
  25. exportRaw(out, data);
  26. }
  27.  
  28. utils.exportObj = exportObj;
  29. utils.$ = $;
  30.  
  31. unsafeWindow.$1 = $;
  32. unsafeWindow.utils = utils;
  33.  
  34. (function() {
  35. 'use strict';
  36. GM_registerMenuCommand(`Copy`, function(){
  37. let obj = $1("#reader-container")
  38. let out = obj.text();
  39. console.log(out)
  40. GM_setClipboard(out)
  41. utils.exportRaw(document.title+".txt", out)
  42. });
  43. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址