Skip to content

Commit aca302f

Browse files
committed
新增 [所有 Flarum 论坛] 支持
1 parent 0da6409 commit aca302f

1 file changed

Lines changed: 72 additions & 70 deletions

File tree

Autopage.user.js

Lines changed: 72 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 1.3.7
3+
// @version 1.3.8
44
// @author X.I.U
5-
// @description 自动无缝翻页,目前支持:所有 Discuz!论坛、423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、异星软件空间、豆瓣电影、微博评论、3DM游戏网、游侠网、游民星空、千图网、阿里小站、RARBG、FitGirl Repacks、AlphaCoders、PubMed、AfreecaTV...
5+
// @description 自动无缝翻页,目前支持:所有Discuz!、Flarum」论坛、423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、异星软件空间、豆瓣电影、微博评论、3DM游戏网、游侠网、游民星空、千图网、阿里小站、RARBG、FitGirl Repacks、AlphaCoders、PubMed、AfreecaTV...
66
// @match *://*/*
77
// @exclude *://www.423down.com/*.html
88
// @exclude *://apphot.cc/*.html
@@ -33,7 +33,6 @@
3333
'rarbgprx.org',
3434
'fitgirl-repacks.site',
3535
'www.yxssp.com',
36-
'pan.yuankongjian.com',
3736
'weibo.com',
3837
'www.afreecatv.com'];
3938

@@ -43,7 +42,10 @@
4342
GM_registerMenuCommand('❎ 已禁用 (点击对当前网站启用)', function(){menu_disable('del')});
4443
return
4544
} else {
46-
if (websiteList.indexOf(location.host) > -1 || document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]')) {
45+
if (websiteList.indexOf(location.host) > -1 // 其他网站列表
46+
|| document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]') // 所有 Discuz! 论坛
47+
|| document.getElementById('flarum-loading') // 所有 Flarum 论坛
48+
) {
4749
GM_registerMenuCommand('✅ 已启用 (点击对当前网站禁用)', function(){menu_disable('add')});
4850
} else {
4951
GM_registerMenuCommand('❌ 当前网站暂不支持 [点击申请支持]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
@@ -137,8 +139,16 @@
137139
scrollDelta: 1000
138140
}
139141
},
140-
_423down_postslist: {
142+
flarum: {
141143
SiteTypeID: 7,
144+
pager: {
145+
type: 2,
146+
nextLink: '.DiscussionList-loadMore > button[title]',
147+
scrollDelta: 1000
148+
}
149+
},
150+
_423down_postslist: {
151+
SiteTypeID: 8,
142152
pager: {
143153
type: 1,
144154
nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]',
@@ -149,7 +159,7 @@
149159
}
150160
},
151161
apphot_postslist: {
152-
SiteTypeID: 8,
162+
SiteTypeID: 9,
153163
pager: {
154164
type: 1,
155165
nextLink: '//div[@class="pagination"]//a[contains(text(),"下一页")][@href]',
@@ -160,7 +170,7 @@
160170
}
161171
},
162172
iao_su_postslist: {
163-
SiteTypeID: 9,
173+
SiteTypeID: 10,
164174
pager: {
165175
type: 1,
166176
nextLink: '//li[@class="btn btn-primary next"]//a[@href]',
@@ -174,7 +184,7 @@
174184
}
175185
},
176186
appinn_postslist: {
177-
SiteTypeID: 10,
187+
SiteTypeID: 11,
178188
pager: {
179189
type: 1,
180190
nextLink: '//a[@class="next page-numbers"][@href]',
@@ -185,7 +195,7 @@
185195
}
186196
},
187197
iplaysoft_postslist: {
188-
SiteTypeID: 11,
198+
SiteTypeID: 12,
189199
pager: {
190200
type: 1,
191201
nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]',
@@ -199,7 +209,7 @@
199209
}
200210
},
201211
iplaysoft_postcomments: {
202-
SiteTypeID: 12,
212+
SiteTypeID: 13,
203213
pager: {
204214
type: 2,
205215
nextLink: '#loadHistoryComments',
@@ -208,7 +218,7 @@
208218
}
209219
},
210220
pubmed_postslist: {
211-
SiteTypeID: 13,
221+
SiteTypeID: 14,
212222
pager: {
213223
type: 2,
214224
nextLink: 'button.load-button.next-page',
@@ -217,7 +227,7 @@
217227
}
218228
},
219229
wall_alphacoders: {
220-
SiteTypeID: 14,
230+
SiteTypeID: 15,
221231
pager: {
222232
type: 1,
223233
nextLink: '//a[@id="next_page"][@href]',
@@ -228,7 +238,7 @@
228238
}
229239
},
230240
art_alphacoders: {
231-
SiteTypeID: 15,
241+
SiteTypeID: 16,
232242
pager: {
233243
type: 1,
234244
nextLink: '//a[@id="next_page"][@href]',
@@ -242,7 +252,7 @@
242252
}
243253
},
244254
fitgirl: {
245-
SiteTypeID: 16,
255+
SiteTypeID: 17,
246256
pager: {
247257
type: 1,
248258
nextLink: '//a[@class="next page-numbers"][@href]',
@@ -253,7 +263,7 @@
253263
}
254264
},
255265
weidown: {
256-
SiteTypeID: 17,
266+
SiteTypeID: 18,
257267
pager: {
258268
type: 1,
259269
nextLink: '//a[@class="nextpage"][@href]',
@@ -264,7 +274,7 @@
264274
}
265275
},
266276
weidown_search: {
267-
SiteTypeID: 18,
277+
SiteTypeID: 19,
268278
pager: {
269279
type: 1,
270280
nextLink: '//a[@class="nextpage"][@href]',
@@ -275,7 +285,7 @@
275285
}
276286
},
277287
weidown_special: {
278-
SiteTypeID: 19,
288+
SiteTypeID: 20,
279289
pager: {
280290
type: 1,
281291
nextLink: '//a[@class="nextpage"][@href]',
@@ -286,7 +296,7 @@
286296
}
287297
},
288298
douban_subject_comments: {
289-
SiteTypeID: 20,
299+
SiteTypeID: 21,
290300
pager: {
291301
type: 1,
292302
nextLink: '//a[@class="next"][@href]',
@@ -297,7 +307,7 @@
297307
}
298308
},
299309
douban_subject_reviews: {
300-
SiteTypeID: 21,
310+
SiteTypeID: 22,
301311
pager: {
302312
type: 1,
303313
nextLink: '//link[@rel="next"][@href]',
@@ -308,7 +318,7 @@
308318
}
309319
},
310320
douban_subject_episode: {
311-
SiteTypeID: 22,
321+
SiteTypeID: 23,
312322
pager: {
313323
type: 1,
314324
nextLink: '//link[@rel="next"][@href]',
@@ -319,7 +329,7 @@
319329
}
320330
},
321331
douban_search: {
322-
SiteTypeID: 23,
332+
SiteTypeID: 24,
323333
pager: {
324334
type: 1,
325335
nextLink: '//a[@class="next"][@href]',
@@ -330,7 +340,7 @@
330340
}
331341
},
332342
_3dmgame: {
333-
SiteTypeID: 24,
343+
SiteTypeID: 25,
334344
pager: {
335345
type: 3,
336346
nextLink: '//li[@class="next"]/a[@href]',
@@ -342,7 +352,7 @@
342352
}
343353
},
344354
gamersky_ent: {
345-
SiteTypeID: 25,
355+
SiteTypeID: 26,
346356
pager: {
347357
type: 3,
348358
nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]',
@@ -354,7 +364,7 @@
354364
}
355365
},
356366
gamersky_gl: {
357-
SiteTypeID: 26,
367+
SiteTypeID: 27,
358368
pager: {
359369
type: 3,
360370
nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]',
@@ -366,7 +376,7 @@
366376
}
367377
},
368378
ali213_www: {
369-
SiteTypeID: 27,
379+
SiteTypeID: 28,
370380
pager: {
371381
type: 3,
372382
nextLink: '//a[@id="after_this_page"][@href]',
@@ -378,7 +388,7 @@
378388
}
379389
},
380390
ali213_gl: {
381-
SiteTypeID: 28,
391+
SiteTypeID: 29,
382392
pager: {
383393
type: 3,
384394
nextLink: '//a[@class="next n"][@href]',
@@ -390,7 +400,7 @@
390400
}
391401
},
392402
_58pic: {
393-
SiteTypeID: 29,
403+
SiteTypeID: 30,
394404
pager: {
395405
type: 1,
396406
nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]',
@@ -404,7 +414,7 @@
404414
}
405415
},
406416
_58pic_c: {
407-
SiteTypeID: 30,
417+
SiteTypeID: 31,
408418
pager: {
409419
type: 1,
410420
nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]',
@@ -418,7 +428,7 @@
418428
}
419429
},
420430
rarbgprx: {
421-
SiteTypeID: 31,
431+
SiteTypeID: 32,
422432
pager: {
423433
type: 1,
424434
nextLink: '(//a[@title="next page"])[1][@href]',
@@ -429,7 +439,7 @@
429439
}
430440
},
431441
yxssp: {
432-
SiteTypeID: 32,
442+
SiteTypeID: 33,
433443
pager: {
434444
type: 1,
435445
nextLink: '//div[@class="page-nav td-pb-padding-side"]/a[last()][@href]',
@@ -439,15 +449,6 @@
439449
scrollDelta: 900
440450
}
441451
},
442-
yuankongjian: {
443-
SiteTypeID: 33,
444-
pager: {
445-
type: 2,
446-
nextLink: 'button[title="加载更多"]',
447-
nextText: '加载更多',
448-
scrollDelta: 500
449-
}
450-
},
451452
weibo_comment: {
452453
SiteTypeID: 34,
453454
pager: {
@@ -556,44 +557,45 @@
556557
case "rarbgprx.org":
557558
curSite = DBSite.rarbgprx;
558559
break;
559-
case "pan.yuankongjian.com":
560-
if (location.pathname.indexOf('/d/') === -1) {
561-
curSite = DBSite.yuankongjian;
562-
}
563-
break;
564560
case "weibo.com":
565561
curSite = DBSite.weibo_comment;
566562
break;
567563
case "www.afreecatv.com":
568564
curSite = DBSite.afreecatv;
569565
break;
570-
default: // < Discuz! 论坛专用 >
571-
if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
572-
if (location.pathname.indexOf('forum') > -1) { // 各版块帖子列表
573-
curSite = DBSite.discuz_forum;
574-
} else if (location.pathname.indexOf('thread') > -1) { // 帖子内
575-
curSite = DBSite.discuz_thread;
576-
hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
577-
}else if(location.pathname.indexOf('search') > -1) { // 搜索结果
578-
curSite = DBSite.discuz_search;
579-
}
580-
} else {
581-
if (location.search.indexOf('mod=forumdisplay') > -1) { // 各版块帖子列表
582-
curSite = DBSite.discuz_forum;
583-
} else if (location.search.indexOf('mod=viewthread') > -1) { // 帖子内
584-
curSite = DBSite.discuz_thread;
585-
hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
586-
} else if (location.search.indexOf('mod=guide') > -1) { // 导读帖子列表
587-
curSite = DBSite.discuz_guide;
588-
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
589-
curSite = DBSite.discuz_youspace;
590-
} else if (location.search.indexOf('mod=collection') > -1) { // 淘贴列表
591-
curSite = DBSite.discuz_collection;
592-
} else if (location.pathname.indexOf('search') > -1) { // 搜索结果
593-
curSite = DBSite.discuz_search;
594-
} else { // 考虑到部分论坛的部分板块帖子列表 URL 是自定义的
595-
curSite = DBSite.discuz_forum;
566+
default:
567+
if (document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]')) {
568+
// < 所有 Discuz!论坛 >
569+
if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
570+
if (location.pathname.indexOf('forum') > -1) { // 各版块帖子列表
571+
curSite = DBSite.discuz_forum;
572+
} else if (location.pathname.indexOf('thread') > -1) { // 帖子内
573+
curSite = DBSite.discuz_thread;
574+
hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
575+
}else if(location.pathname.indexOf('search') > -1) { // 搜索结果
576+
curSite = DBSite.discuz_search;
577+
}
578+
} else {
579+
if (location.search.indexOf('mod=forumdisplay') > -1) { // 各版块帖子列表
580+
curSite = DBSite.discuz_forum;
581+
} else if (location.search.indexOf('mod=viewthread') > -1) { // 帖子内
582+
curSite = DBSite.discuz_thread;
583+
hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
584+
} else if (location.search.indexOf('mod=guide') > -1) { // 导读帖子列表
585+
curSite = DBSite.discuz_guide;
586+
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
587+
curSite = DBSite.discuz_youspace;
588+
} else if (location.search.indexOf('mod=collection') > -1) { // 淘贴列表
589+
curSite = DBSite.discuz_collection;
590+
} else if (location.pathname.indexOf('search') > -1) { // 搜索结果
591+
curSite = DBSite.discuz_search;
592+
} else { // 考虑到部分论坛的部分板块帖子列表 URL 是自定义的
593+
curSite = DBSite.discuz_forum;
594+
}
596595
}
596+
} else if (document.getElementById('flarum-loading') && location.pathname.indexOf('/d/') === -1) {
597+
// < 所有 Flarum 论坛 >
598+
curSite = DBSite.flarum;
597599
}
598600
}
599601
curSite.pageUrl = ""; // 下一页URL

0 commit comments

Comments
 (0)