// ==UserScript== // @name 找学习资料大师[电子书搜索神器]支持豆瓣/鸠摩搜书 // @namespace ilovexuexi // @match *://www.jiumodiary.com/* // @match *://m.douban.com/book/subject/* // @match *://book.douban.com/subject/* // @match *://www.forkdoc.com/Center/prev.asp // @grant GM_xmlhttpRequest // @connect * // @connect *://*.886889.xyz // @version 1.6 // @author - // @description 帮你找到你想要的学习资料,搜索到绝大部分的电子书,支持豆瓣电脑端/手机端,支持鸠摩搜书扩展搜索结果 // @require https://cdn.staticfile.org/jquery/1.10.0/jquery.js // @require https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js // @require https://cdn.jsdelivr.net/npm/sweetalert2@10.10.0/dist/sweetalert2.all.min.js // @icon https://www.xuexi.cn/favicon.ico // @downloadURL https://update.greasyfork.icu/scripts/423587/%E6%89%BE%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%96%99%E5%A4%A7%E5%B8%88%5B%E7%94%B5%E5%AD%90%E4%B9%A6%E6%90%9C%E7%B4%A2%E7%A5%9E%E5%99%A8%5D%E6%94%AF%E6%8C%81%E8%B1%86%E7%93%A3%E9%B8%A0%E6%91%A9%E6%90%9C%E4%B9%A6.user.js // @updateURL https://update.greasyfork.icu/scripts/423587/%E6%89%BE%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%96%99%E5%A4%A7%E5%B8%88%5B%E7%94%B5%E5%AD%90%E4%B9%A6%E6%90%9C%E7%B4%A2%E7%A5%9E%E5%99%A8%5D%E6%94%AF%E6%8C%81%E8%B1%86%E7%93%A3%E9%B8%A0%E6%91%A9%E6%90%9C%E4%B9%A6.meta.js // ==/UserScript== (function() { var ver = '1.6'; function tips(title,content,force=false){ key = md5(content+ver); if(force == false){ if(getStorage(key) != 'ok'){ Swal.fire({ title: title, width:'800px', html: content, allowOutsideClick:false, confirmButtonText: '关闭' }); } }else{ Swal.fire({ title: title, width:'800px', html: content, allowOutsideClick:false, confirmButtonText: '关闭' }); } setStorage(key, 'ok'); } function getStorage(key) { return localStorage.getItem(key) } function setStorage(key, value) { return localStorage.setItem(key, value) } function get_book_id(url) { let re = /\/subject\/(\d+)/g; let matches = re.exec(url); if (matches && matches.length > 1) { return parseInt(matches[1]); } } function getExt(fileName) { var fileExtension = fileName.split('.').pop().toUpperCase(); return fileExtension; } function formatBytes($size) { $units = new Array(' B', ' KB', ' MB', ' GB', ' TB'); for ($i = 0; $size >= 1024 && $i < 4; $i++) { $size /= 1024; } return $size.toFixed(2) + $units[$i]; } function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; var year = date.getFullYear(); var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = year + seperator1 + month + seperator1 + strDate; return currentdate; } $(document).on('click', '#addnew', function() { url = "https://ops.886889.xyz/addnew.php?ver=" + ver; //console.log($("#addnewform").serialize()); GM_xmlhttpRequest({ method: "POST", url: url, data :$("#addnewform").serialize(), headers: { "Referer": "https://www.baidu.com/" }, onload: function(res) { console.log($("#addnewform").serialize()); if (res.status == 200) { $res = $.parseJSON(res.response); console.log($res); if($res.status == 'success'){ $('[name="md5"]').val(''); //$('[name="name"]').val(''); $('[name="ext"]').val(''); } alert($res.msg); } else { alert('无响应'); } } }); }); var urlstr = decodeURI(location.href); n = urlstr.search("//www.forkdoc.com/Center/prev.asp"); if(n !== -1){ $result = $.parseJSON($('body').html()); if($result.type == 200){ if(confirm('转存成功需要跳转到你的主页查看吗?')){ window.location.href= "//www.forkdoc.com/Center/ownfiles.asp"; } }else{ alert('啊哦,转存失败了,自己看看错误代码吧,如果是未登录请重新登录后重试') } }else{ GM_xmlhttpRequest({ method: "POST", url: 'https://ops.886889.xyz/tips.php?ver='+ver, data :$("#addnewform").serialize(), headers: { "Referer": "https://www.baidu.com/" }, onload: function(res) { if (res.status == 200) { $res = $.parseJSON(res.response); if($res.ver > ver){ $message = '不能使用的版本,正在使用的版本为'+ver+',已发布的最新版本为'+$res.ver+'。请尽快升级到最新版本。点击确定或取消均会跳转至最新的下载页面'; if(confirm($message)){ window.location.href=$res.update_url; }else{ window.location.href=$res.update_url; } return false; } //console.log($res); if($res.status == 'success'){ n = urlstr.search("//m.douban.com/book/subject/"); if(n !== -1){ $template = '