Skip to content

Commit fdbb178

Browse files
committed
新增 [搜狗搜索]、[搜狗微信]、[Magi 搜索] 支持
1 parent 6154ce4 commit fdbb178

1 file changed

Lines changed: 66 additions & 16 deletions

File tree

Autopage.user.js

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 2.0.5
3+
// @version 2.0.6
44
// @author X.I.U
5-
// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、看雪论坛、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic(嗨漫画)、动漫之家、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl(更多的写不下了...
5+
// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、微信、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、看雪论坛、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic(嗨漫画)、动漫之家、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl(更多的写不下了...
66
// @match *://*/*
77
// @connect www.gamersky.com
88
// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
@@ -111,7 +111,7 @@
111111
nextTextOf: '下一页',
112112
scrollDelta: 1500
113113
}
114-
}, // Discuz! - 各版块帖子列表(自带无缝加载下一页按钮的)
114+
}, // Discuz! - 各版块帖子列表(自带无缝加载下一页按钮的)
115115
discuz_guide: {
116116
SiteTypeID: 0,
117117
pager: {
@@ -122,7 +122,7 @@
122122
replaceE: 'css;.pg, .pages',
123123
scrollDelta: 1000
124124
}
125-
}, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的)
125+
}, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的)
126126
discuz_waterfall: {
127127
SiteTypeID: 0,
128128
pager: {
@@ -133,7 +133,7 @@
133133
replaceE: 'css;.pg, .pages',
134134
scrollDelta: 1000
135135
}
136-
}, // Discuz! - 图片模式的各版块帖子列表(不带无缝加载下一页按钮的)
136+
}, // Discuz! - 图片模式的各版块帖子列表(不带无缝加载下一页按钮的)
137137
discuz_thread: {
138138
SiteTypeID: 0,
139139
pager: {
@@ -144,7 +144,7 @@
144144
replaceE: 'css;.pg, .pages',
145145
scrollDelta: 1000
146146
}
147-
}, // Discuz! - 帖子内
147+
}, // Discuz! - 帖子内
148148
discuz_search: {
149149
SiteTypeID: 0,
150150
pager: {
@@ -155,7 +155,7 @@
155155
replaceE: 'css;.pg, .pages',
156156
scrollDelta: 1000
157157
}
158-
}, // Discuz! - 搜索页
158+
}, // Discuz! - 搜索页
159159
discuz_youspace: {
160160
SiteTypeID: 0,
161161
pager: {
@@ -166,7 +166,7 @@
166166
replaceE: 'css;.pg, .pages',
167167
scrollDelta: 1000
168168
}
169-
}, // Discuz! - 回复页、主题页(别人的)
169+
}, // Discuz! - 回复页、主题页(别人的)
170170
discuz_collection: {
171171
SiteTypeID: 0,
172172
pager: {
@@ -177,7 +177,7 @@
177177
replaceE: 'css;.pg, .pages',
178178
scrollDelta: 1000
179179
}
180-
}, // Discuz! - 淘帖页
180+
}, // Discuz! - 淘帖页
181181
flarum: {
182182
SiteTypeID: 0,
183183
pager: {
@@ -199,7 +199,7 @@
199199
function: {
200200
before: dux_functionBefore
201201
}
202-
}, // 一种 WordPress 主题
202+
}, // 一种 WordPress 主题
203203
baidu: {
204204
SiteTypeID: 0,
205205
host: 'www.baidu.com',
@@ -212,7 +212,7 @@
212212
replaceE: 'css;#page',
213213
scrollDelta: 1200
214214
}
215-
}, // 百度搜素
215+
}, // 百度搜素
216216
google: {
217217
SiteTypeID: 0,
218218
host: 'www.google.com',
@@ -226,7 +226,7 @@
226226
scriptType: 1,
227227
scrollDelta: 3000
228228
}
229-
}, // 谷歌搜索
229+
}, // 谷歌搜索
230230
bing: {
231231
SiteTypeID: 0,
232232
host: ['www.bing.com','cn.bing.com'],
@@ -239,7 +239,58 @@
239239
replaceE: 'css;#b_results > .b_pag',
240240
scrollDelta: 1500
241241
}
242-
}, // 必应搜索
242+
}, // 必应搜索
243+
sogou: {
244+
SiteTypeID: 0,
245+
host: 'www.sogou.com',
246+
functionStart: function() {if (location.pathname != '/') {curSite = DBSite.sogou;}},
247+
pager: {
248+
type: 1,
249+
nextLink: 'css;#sogou_next',
250+
pageElement: 'css;.results > *',
251+
insertPosition: ['css;.results', 3],
252+
replaceE: 'css;#pagebar_container',
253+
scriptType: 4,
254+
scrollDelta: 1200
255+
}
256+
}, // 搜狗搜索
257+
sogou_weixin: {
258+
SiteTypeID: 0,
259+
host: 'weixin.sogou.com',
260+
functionStart: function() {if (location.pathname === '/') {
261+
curSite = DBSite.sogou_weixin;
262+
} else if (location.pathname === '/weixin') {
263+
curSite = DBSite.sogou_weixin_search;
264+
}},
265+
pager: {
266+
type: 2,
267+
nextLink: '#look-more',
268+
intervals: 1000,
269+
scrollDelta: 1000
270+
}
271+
}, // 搜狗微信 - 首页
272+
sogou_weixin_search: {
273+
SiteTypeID: 0,
274+
pager: {
275+
type: 1,
276+
nextLink: 'css;#sogou_next',
277+
pageElement: 'css;.news-box > ul[class*="news-list"] > li',
278+
insertPosition: ['css;.news-box > ul[class*="news-list"]', 3],
279+
replaceE: 'css;#pagebar_container',
280+
scrollDelta: 1000
281+
}
282+
}, //搜狗微信 - 搜索
283+
magi: {
284+
SiteTypeID: 0,
285+
host: 'magi.com',
286+
functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.magi;}},
287+
pager: {
288+
type: 2,
289+
nextLink: '.card[data-type="next"]',
290+
nextText: '加载更多',
291+
scrollDelta: 1500
292+
}
293+
}, // Magi 搜索
243294
baidu_tieba: {
244295
SiteTypeID: 0,
245296
host: 'tieba.baidu.com',
@@ -1922,8 +1973,7 @@
19221973
// [Discuz! 论坛] 图片模式列表样式预处理
19231974
function waterfallStyle() {
19241975
let width = document.querySelector('#waterfall > li:first-child').style.width;
1925-
document.lastChild.appendChild(document.createElement('style')).textContent = `#waterfall {height: auto !important; width: 100% !important;}
1926-
#waterfall > li {width: ${width} !important; float: left !important; position: inherit !important; left: auto !important; top: auto !important;}`;
1976+
document.lastChild.appendChild(document.createElement('style')).textContent = `#waterfall {height: auto !important; width: 100% !important;} #waterfall > li {width: ${width} !important; float: left !important; position: inherit !important; left: auto !important; top: auto !important;}`;
19271977
}
19281978

19291979

@@ -2823,7 +2873,7 @@
28232873

28242874
if (support) {
28252875
console.info('[自动无缝翻页] - 其他网站(独立规则)'); return 1;
2826-
} else if (document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]') || document.getElementById('ft') && document.getElementById('ft').textContent.indexOf('Discuz!') > -1) {
2876+
} else if (document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]') || document.querySelector('a[href*="www.discuz.net"]') && document.querySelector('a[href*="www.discuz.net"]').textContent.indexOf('Discuz!') > -1) {
28272877
console.info('[自动无缝翻页] - Discuz! 论坛'); return 2;
28282878
} else if (document.getElementById('flarum-loading')) {
28292879
console.info('[自动无缝翻页] - Flarum 论坛'); return 3;

0 commit comments

Comments
 (0)