长佩书单
长佩书单
分享者: guaner001125 (317)发布时间: 2024/04/18
设置源变量搜索书单
{ "articleStyle": 2, "contentWhitelist": "", "customOrder": 43, "enableJs": true, "enabled": true, "enabledCookieJar": true, "header": "{\n \"User-Agent\": \"Mozilla\/5.0 (Linux; Android 8.1.0; JKM-AL00b Build\/HUAWEIJKM-AL00b; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/66.0.3359.126 MQQBrowser\/6.2 TBS\/044807 Mobile Safari\/537.36\"\n}", "injectJs": "\/\/ 获取书籍链接\nbookid = String(window.location.href).match(\/novel-(\\d+)\/)[1];\n\t\n\tbooksrc = \"https:\/\/webapi.gongzicp.com\/novel\/novelInfo?id=\"+bookid;\n\t\n\taddbook = `legado:\/\/import\/addToBookshelf?src=${encodeURIComponent(booksrc)},{origin:'https:\/\/webapi.gongzicp.com'}`;\n\t\n fetch(booksrc)\n .then((response) => response.json())\n .then((data) =>{\n \ttitle = data.data.novel_name\n \t\n \t\/\/获取作者名称\nauthor = data.data.author_nickname;\n\n\/\/create(搜索的内容,\"bookName or bookAuthor\",距离顶部距离,[跳转其他url])\ncreate(title,\"addBookshelf\",14,addbook);\ncreate(title,\"bookName\",18)\ncreate(author,\"bookAuthor\",22)\n\n \t\n \t});\nfunction create(name,type,top,url){\n \t type = type+\"=\"+name;\n \t url = url!=undefined?url+\"#\"+type:\"\";\n \t \n let \ttypebutton;\n if(\/bookName\/.test(type)){\n \t typebutton=\"搜索书名\"\n \t}else if(\/bookAuthor\/.test(type)){\n \t\t typebutton=\"搜索作者\"\n \t}else{\n \t\t\t typebutton=\"加入书架\"\n \t}\n \n \tlet Url = location.search!=\"\"?location.search.replace(\/&*book[AN].*?=.*\/,'')+\"&\"+type:window.location.pathname+\"?\"+type;\n \turl = url!=\"\"?url:Url;\n \tA = document.createElement(\"a\");\n\t\t A.href = url.replace(\/#addBookshelf.*\/,'');\n\t\t\n\t\tA.innerHTML = `<button style=\"outline:none; position:fixed; top:${top}%; right:7%; z-index:999; border-radius:5px; color:#166188;background:#fff;padding:4px;border:1px solid #000\"><b>${typebutton}<\/b><\/button>`;\n \tdocument.body.appendChild(A);\n \t}\t", "lastUpdateTime": 0, "loadWithBaseUrl": true, "ruleArticles": "$.data.list[*]", "ruleContent": "", "ruleImage": "$.collection_cover##\\?.*", "ruleLink": "https:\/\/m.gongzicp.com\/home\/bookView-{{$.collection_id}}.html", "ruleNextPage": "<js>\nif(\/getList\/.test(baseUrl)){\n\tresult = \"https:\/\/m.gongzicp.com\/webapi\/book\/getList?type=3&pre={{$.data.pre}}&bid=0\"\n\t}else{\n\t\tresult = baseUrl.replace(\/page=\\d+\/,\"page=\"+(Number(baseUrl.match(\/page=(\\d+)\/)[1])+1));\n\t\t\n\t\t\t}\n\t\t\n<\/js>", "rulePubDate": "{{$.category}}•{{$.collection_list_count}}本•{{$.collection_intro}}", "ruleTitle": "$.collection_name", "shouldOverrideUrlLoading": "if(\/[\\?#&]book[AN]\/.test(url)){\n\ttitle = url.match(\/[\\?#&]book[AN].+?=(.*)\/)[1];\n\tURLDecoder = Packages.java.net.URLDecoder;\n\tgb2312Str = URLDecoder.decode(title,\"gbk\");\n utf8Str = URLDecoder.decode(title,\"utf-8\");\n\t result = gb2312Str.length() >= utf8Str.length();\n\t title = result?decodeURI(title):gb2312Str;\n\tjava.searchBook(title)\n\t}", "singleUrl": false, "sortUrl": "最新书单::https:\/\/m.gongzicp.com\/webapi\/book\/getList?type=3&pre=0&bid=0\n热门书单::https:\/\/m.gongzicp.com\/webapi\/book\/getList?type=2&pre=0&bid=0\n推荐书单::https:\/\/m.gongzicp.com\/webapi\/book\/getList?type=1&pre=0&bid=0\n搜索书单::https:\/\/m.gongzicp.com\/webapi\/search\/books?k={{source.getVariable()}}&page=1", "sourceComment": "设置源变量搜索书单", "sourceIcon": "https:\/\/pp.myapp.com\/ma_icon\/0\/icon_52680621_1713258197\/256", "sourceName": "长佩书单", "sourceUrl": "长佩书单", "style": "" }