Skip to content

Commit a2b13da

Browse files
committed
新增 [CS.RIN.RU] 搜索结果页支持; 优化 规则
1 parent e5645e7 commit a2b13da

1 file changed

Lines changed: 23 additions & 62 deletions

File tree

Autopage.user.js

Lines changed: 23 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 1.6.7
3+
// @version 1.6.8
44
// @author X.I.U
5-
// @description 无缝拼接下一页内容,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、千图网、Pixabay、3DM、游侠网、游民星空、Steam 创意工坊、423Down、Sordum、不死鸟、小众软件、六音软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、漫画DB、HiComic(嗨漫画)、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、CS.RIN.RU、Crackhub213、FitGirl Repacks...
5+
// @description 无缝拼接下一页内容,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、千图网、Pixabay、3DM、游侠网、游民星空、Steam 创意工坊、423Down、Sordum、不死鸟、小众软件、六音软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、漫画DB、HiComic(嗨漫画)、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、CS.RIN.RU、Crackhub213、FitGirl Repacks...
66
// @match *://*/*
77
// @connect www.gamersky.com
88
// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
@@ -29,7 +29,6 @@
2929
'www.423down.com', 'www.sordum.org', 'iao.su', 'www.appinn.com', 'www.sixyin.com', 'www.weidown.com', 'www.iplaysoft.com', 'www.mpyit.com', 'www.yxssp.com',
3030
'www.manhuadb.com', 'www.hicomic.net', 'www.gufengmh8.com', 'www.szcdmj.com',
3131
'rarbgprx.org', 'pubmed.ncbi.nlm.nih.gov', 'www.afreecatv.com', 'greasyfork.org',
32-
'art.alphacoders.com', 'wall.alphacoders.com', 'avatars.alphacoders.com', 'mobile.alphacoders.com',
3332
'cs.rin.ru', 'crackhub.site', 'fitgirl-repacks.site'];
3433

3534
if (GM_getValue('menu_disable') == null){GM_setValue('menu_disable', [])};
@@ -175,7 +174,7 @@
175174
SiteTypeID: 0,
176175
pager: {
177176
type: 1,
178-
nextLink: '//div[@id="page"]//a[contains(text(),"下一页")][@href]',
177+
nextLink: 'id("page")//a[contains(text(),"下一页")][@href]',
179178
pageElement: 'css;#content_left > *',
180179
HT_insert: ['css;#content_left', 3],
181180
replaceE: 'css;#page',
@@ -186,11 +185,11 @@
186185
SiteTypeID: 0,
187186
pager: {
188187
type: 1,
189-
nextLink: '//a[@id="pnnext"][@href]',
188+
nextLink: 'id("pnnext")[@href]',
190189
pageElement: 'css;#res > *',
191190
HT_insert: ['css;#res', 3],
192-
replaceE: '//div[@id="navcnt"] | //div[@id="rcnt"]//div[@role="navigation"]',
193-
scrollDelta: 1500
191+
replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
192+
scrollDelta: 2000
194193
}
195194
},
196195
bing: {
@@ -340,7 +339,7 @@
340339
SiteTypeID: 0,
341340
pager: {
342341
type: 3,
343-
nextLink: '//a[@id="after_this_page"][@href]',
342+
nextLink: 'id("after_this_page")[@href]',
344343
pageElement: 'css;#Content >*:not(.news_ding):not(.page_fenye)',
345344
HT_insert: ['css;.page_fenye', 1],
346345
replaceE: 'css;.page_fenye',
@@ -665,31 +664,6 @@
665664
scrollDelta: 1000
666665
}
667666
},
668-
alphacoders_art: {
669-
SiteTypeID: 0,
670-
pager: {
671-
type: 1,
672-
nextLink: '//a[@id="next_page"][@href]',
673-
pageElement: 'css;.container-masonry > div',
674-
HT_insert: ['css;.container-masonry', 3],
675-
replaceE: '//div[@class="hidden-xs hidden-sm"]/..',
676-
scrollDelta: 1000
677-
},
678-
function: {
679-
before: alphacoders_art_beforeFunction
680-
}
681-
},
682-
alphacoders_wall: {
683-
SiteTypeID: 0,
684-
pager: {
685-
type: 1,
686-
nextLink: '//a[@id="next_page"][@href]',
687-
pageElement: 'css;.page_container > .center > div',
688-
HT_insert: ['css;.page_container > .center', 3],
689-
replaceE: '//div[@class="hidden-xs hidden-sm"]/..',
690-
scrollDelta: 1000
691-
}
692-
},
693667
cs_rin_ru: {
694668
SiteTypeID: 0,
695669
pager: {
@@ -715,6 +689,17 @@
715689
scrollDelta: 1500
716690
}
717691
},
692+
cs_rin_ru_search: {
693+
SiteTypeID: 0,
694+
pager: {
695+
type: 1,
696+
nextLink: 'id("wrapcentre")/div[@class="nav"]//a[text()="Next"]',
697+
pageElement: 'css;#wrapcentre > form > table.tablebg > tbody > tr[valign]',
698+
HT_insert: ['css;#wrapcentre > form > table.tablebg > tbody > tr:last-child', 1],
699+
replaceE: 'css;#wrapcentre > div',
700+
scrollDelta: 1500
701+
}
702+
},
718703
fitgirl: {
719704
SiteTypeID: 0,
720705
pager: {
@@ -891,20 +876,13 @@
891876
curSite = DBSite.greasyfork_discussions;
892877
}
893878
break;
894-
case 'art.alphacoders.com': // < 壁纸网站 >
895-
curSite = DBSite.alphacoders_art;
896-
setTimeout(alphacoders_art_beforeFunction_0, 1000);
897-
break;
898-
/*case 'wall.alphacoders.com': // 这几个已经原生支持自动无缝翻页了
899-
case 'avatars.alphacoders.com':
900-
case 'mobile.alphacoders.com':
901-
curSite = DBSite.alphacoders_wall;
902-
break;*/
903-
case 'cs.rin.ru': // < cs_rin_ru >
904-
if (location.pathname === '/forum/viewforum.php') { // 版块帖子列表
879+
case 'cs.rin.ru': // < 游戏下载论坛 >
880+
if (location.pathname === '/forum/viewforum.php') { // 版块帖子列表
905881
curSite = DBSite.cs_rin_ru;
906882
} else if (location.pathname === '/forum/viewtopic.php') { // 帖子内
907883
if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.cs_rin_ru_viewtopic;
884+
} else if (location.pathname === '/forum/search.php') { // 搜索结果
885+
curSite = DBSite.cs_rin_ru_search;
908886
}
909887
break;
910888
case 'crackhub.site': // < 游戏下载网站 >
@@ -1085,24 +1063,7 @@
10851063
}
10861064

10871065

1088-
// alphacoders_art 的插入前函数(图片结构调整)
1089-
function alphacoders_art_beforeFunction(pageElems) {
1090-
pageElems.forEach(function (one) {
1091-
one.style.float = 'left';
1092-
});
1093-
return pageElems
1094-
}
1095-
// alphacoders_art(图片结构调整)
1096-
function alphacoders_art_beforeFunction_0() {
1097-
let pageElems1 = document.querySelectorAll('.container-masonry > div')
1098-
document.querySelector('.container-masonry').style.height = 'auto'
1099-
pageElems1.forEach(function (one) {
1100-
one.style.float = 'left';
1101-
});
1102-
}
1103-
1104-
1105-
// cs_rin_ru 的插入前函数(过滤置顶帖子)
1066+
// cs_rin_ru 各版块帖子列表的插入前函数(过滤置顶帖子)
11061067
function cs_rin_ru_beforeFunction(pageElems) {
11071068
for (let i = 0; i < pageElems.length; i++) {
11081069
if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {

0 commit comments

Comments
 (0)