rsshub 1.0.0-master.e6d4e1e → 1.0.0-master.e6d53dc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/radar/rules/all.ts +3 -6
- package/lib/api/radar/rules/one.ts +3 -6
- package/lib/config.ts +12 -22
- package/lib/errors/index.tsx +1 -1
- package/lib/index.ts +1 -1
- package/lib/middleware/anti-hotlink.test.ts +191 -6
- package/lib/middleware/anti-hotlink.ts +28 -0
- package/lib/middleware/parameter.test.ts +22 -5
- package/lib/middleware/parameter.ts +47 -17
- package/lib/registry.test.ts +8 -0
- package/lib/registry.ts +2 -0
- package/lib/router.js +0 -3
- package/lib/routes/141jav/index.ts +25 -21
- package/lib/routes/141ppv/index.ts +24 -20
- package/lib/routes/51read/article.ts +82 -0
- package/lib/routes/51read/namespace.ts +6 -0
- package/lib/routes/5eplay/utils.ts +5 -3
- package/lib/routes/agri/index.ts +307 -0
- package/lib/routes/agri/namespace.ts +8 -0
- package/lib/routes/agri/templates/description.art +21 -0
- package/lib/routes/aljazeera/index.ts +2 -2
- package/lib/routes/apnews/sitemap.ts +98 -0
- package/lib/routes/apnews/utils.ts +7 -5
- package/lib/routes/autocentre/index.ts +29 -0
- package/lib/routes/autocentre/namespace.ts +7 -0
- package/lib/routes/bilibili/api-interface.d.ts +1 -0
- package/lib/routes/bilibili/cache.ts +3 -1
- package/lib/routes/bilibili/dynamic.ts +7 -9
- package/lib/routes/binance/announcement.ts +168 -0
- package/lib/routes/binance/types.ts +26 -0
- package/lib/routes/bing/daily-wallpaper.ts +1 -1
- package/lib/routes/bjnews/cat.ts +43 -0
- package/lib/routes/bjnews/column.ts +43 -0
- package/lib/routes/bjnews/namespace.ts +6 -0
- package/lib/routes/bjnews/utils.ts +19 -0
- package/lib/routes/bjx/fd.ts +35 -26
- package/lib/routes/buaa/jiaowu.ts +1 -1
- package/lib/routes/buaa/lib/space/newbook.ts +171 -0
- package/lib/routes/buaa/lib/space/templates/newbook.art +44 -0
- package/lib/routes/cccfna/index.ts +2 -2
- package/lib/routes/cctv/category.ts +16 -12
- package/lib/routes/cctv/xwlb.ts +32 -10
- package/lib/routes/cdu/jwgg.ts +79 -0
- package/lib/routes/cdu/namespace.ts +6 -0
- package/lib/routes/cffex/announcement.ts +73 -0
- package/lib/routes/cffex/namespace.ts +6 -0
- package/lib/routes/chlinlearn/daily-blog.ts +55 -0
- package/lib/routes/chlinlearn/namespcae.ts +6 -0
- package/lib/routes/copymanga/comic.ts +3 -1
- package/lib/routes/devolverdigital/blog.ts +59 -42
- package/lib/routes/digitalcameraworld/news.ts +1 -1
- package/lib/routes/discord/channel.ts +10 -10
- package/lib/routes/discord/discord-api.ts +27 -32
- package/lib/routes/discord/templates/message.art +15 -0
- package/lib/routes/discourse/notifications.ts +2 -1
- package/lib/routes/dongqiudi/result.ts +1 -1
- package/lib/routes/eastmoney/report/index.ts +63 -15
- package/lib/routes/eastmoney/templates/stock_description.art +36 -0
- package/lib/routes/eastmoney/utils.ts +35 -0
- package/lib/routes/fediverse/timeline.ts +35 -18
- package/lib/routes/flashcat/blog.ts +61 -0
- package/lib/routes/flashcat/namespace.ts +6 -0
- package/lib/routes/ftm/index.ts +60 -0
- package/lib/routes/ftm/namespace.ts +6 -0
- package/lib/routes/galxe/index.ts +94 -0
- package/lib/routes/galxe/namespace.ts +9 -0
- package/lib/routes/gamersky/ent.ts +57 -0
- package/lib/routes/gamersky/namespace.ts +10 -0
- package/lib/routes/gamersky/news.ts +91 -0
- package/lib/routes/gamersky/review.ts +80 -0
- package/lib/routes/gamersky/utils.ts +94 -0
- package/lib/routes/gdut/oa-news.ts +12 -17
- package/lib/routes/gisreportsonline/index.ts +60 -0
- package/lib/routes/gisreportsonline/namespace.ts +6 -0
- package/lib/routes/github/activity.ts +4 -3
- package/lib/routes/github/search.ts +20 -18
- package/lib/routes/google/research.ts +45 -0
- package/lib/routes/gov/cbirc/index.ts +371 -0
- package/lib/routes/gov/chongqing/sydwgkzp.ts +4 -4
- package/lib/routes/gov/lswz/index.ts +289 -0
- package/lib/routes/gov/zj/ningbogzw-notice.ts +50 -0
- package/lib/routes/gov/zj/ningborsjnotice.ts +50 -0
- package/lib/routes/gq/news.ts +1 -1
- package/lib/routes/gs/developer/blog.ts +58 -0
- package/lib/routes/gs/namespace.ts +9 -0
- package/lib/routes/healthz.ts +8 -0
- package/lib/routes/hket/index.ts +80 -76
- package/lib/routes/hottoys/index.ts +63 -0
- package/lib/routes/hottoys/namespace.ts +6 -0
- package/lib/routes/hust/gs.ts +281 -0
- package/lib/routes/hust/namespace.ts +1 -1
- package/lib/routes/imhcg/blog.ts +47 -0
- package/lib/routes/imhcg/namespace.ts +7 -0
- package/lib/routes/imop/namespace.ts +10 -0
- package/lib/routes/imop/tianshu.ts +53 -0
- package/lib/routes/infzm/hot.ts +39 -0
- package/lib/routes/infzm/index.ts +3 -30
- package/lib/routes/infzm/utils.ts +34 -0
- package/lib/routes/inspirehep/author.ts +46 -0
- package/lib/routes/inspirehep/literature.ts +42 -0
- package/lib/routes/inspirehep/namespace.ts +7 -0
- package/lib/routes/inspirehep/types.ts +210 -0
- package/lib/routes/inspirehep/utils.ts +15 -0
- package/lib/routes/iwara/subscriptions.ts +1 -1
- package/lib/routes/javdb/actors.ts +6 -2
- package/lib/routes/joins/chinese.ts +218 -0
- package/lib/routes/joins/namespace.ts +8 -0
- package/lib/routes/joins/templates/description.art +17 -0
- package/lib/routes/juejin/dynamic.ts +114 -0
- package/lib/routes/kaopu/news.ts +3 -3
- package/lib/routes/kemono/index.ts +21 -0
- package/lib/routes/keylol/index.ts +56 -11
- package/lib/routes/kurogames/namespace.ts +7 -0
- package/lib/routes/kurogames/wutheringwaves/news.ts +59 -0
- package/lib/routes/link3/events.ts +86 -0
- package/lib/routes/link3/namespace.ts +6 -0
- package/lib/routes/link3/profile.ts +143 -0
- package/lib/routes/linkedin/cn/renderer.ts +1 -1
- package/lib/routes/lmu/jobs.ts +96 -0
- package/lib/routes/lmu/namespace.ts +17 -0
- package/lib/routes/lmu/templates/jobPosting.art +11 -0
- package/lib/routes/mcmod/index.ts +105 -0
- package/lib/routes/mcmod/namespace.ts +6 -0
- package/lib/routes/mcmod/templates/mod.art +13 -0
- package/lib/routes/misskey/user-timeline.ts +42 -0
- package/lib/routes/misskey/utils.ts +41 -1
- package/lib/routes/nationalgeographic/latest-stories.ts +1 -1
- package/lib/routes/nationalgeographic/templates/stories.art +1 -1
- package/lib/routes/newyorker/news.ts +24 -17
- package/lib/routes/oschina/news.ts +2 -0
- package/lib/routes/people/index.ts +4 -2
- package/lib/routes/picnob/user.ts +11 -3
- package/lib/routes/pixiv/search.ts +20 -1
- package/lib/routes/pixiv/utils.ts +3 -3
- package/lib/routes/psyche/topic.ts +1 -1
- package/lib/routes/psyche/type.ts +1 -1
- package/lib/routes/psyche/utils.ts +1 -1
- package/lib/routes/questn/community.ts +76 -0
- package/lib/routes/questn/events.ts +101 -0
- package/lib/routes/questn/namespace.ts +6 -0
- package/lib/routes/questn/util.ts +16 -0
- package/lib/routes/rebase/geekdaily.ts +35 -0
- package/lib/routes/rebase/namespace.ts +6 -0
- package/lib/routes/rss3/index.ts +22 -13
- package/lib/routes/rss3/interfaces/metadata.ts +67 -0
- package/lib/routes/rsshub/routes.ts +18 -12
- package/lib/routes/samd/news.ts +1 -1
- package/lib/routes/sara/index.ts +1 -1
- package/lib/routes/scut/gzic/media.ts +71 -0
- package/lib/routes/scut/gzic/news.ts +65 -0
- package/lib/routes/scut/gzic/notice.ts +88 -0
- package/lib/routes/shiep/config.ts +4 -10
- package/lib/routes/shiep/index.ts +9 -9
- package/lib/routes/showstart/artist.ts +5 -4
- package/lib/routes/showstart/brand.ts +5 -4
- package/lib/routes/showstart/event.ts +8 -7
- package/lib/routes/showstart/search.ts +43 -9
- package/lib/routes/showstart/service.ts +81 -53
- package/lib/routes/showstart/site.ts +41 -0
- package/lib/routes/showstart/utils.ts +9 -8
- package/lib/routes/sis001/author.ts +52 -0
- package/lib/routes/sis001/common.ts +38 -0
- package/lib/routes/sis001/forum.ts +2 -29
- package/lib/routes/sjtu/jwc.ts +4 -1
- package/lib/routes/sjtu/namespace.ts +1 -1
- package/lib/routes/sjtu/seiee/index.ts +97 -0
- package/lib/routes/smzdm/product.ts +86 -0
- package/lib/routes/spotify/show.ts +1 -1
- package/lib/routes/springer/journal.ts +10 -12
- package/lib/routes/sse/sselawsrules.ts +370 -0
- package/lib/routes/sspai/author.ts +1 -1
- package/lib/routes/sspai/column.ts +1 -1
- package/lib/routes/sspai/index.ts +1 -1
- package/lib/routes/sspai/matrix.ts +1 -1
- package/lib/routes/sspai/series-update.ts +1 -1
- package/lib/routes/sspai/tag.ts +1 -1
- package/lib/routes/sspai/topic.ts +1 -1
- package/lib/routes/sustainabilitymag/articles.ts +2 -0
- package/lib/routes/szse/rule.ts +315 -42
- package/lib/routes/t66y/index.ts +29 -7
- package/lib/routes/taoguba/blog.ts +1 -1
- package/lib/routes/taoguba/index.ts +1 -1
- package/lib/routes/techcrunch/news.ts +20 -29
- package/lib/routes/techcrunch/templates/description.art +7 -0
- package/lib/routes/telegram/channel.ts +34 -1
- package/lib/routes/test/index.ts +50 -43
- package/lib/routes/the/index.ts +210 -0
- package/lib/routes/the/namespace.ts +8 -0
- package/lib/routes/the/templates/description.art +27 -0
- package/lib/routes/the/util.ts +307 -0
- package/lib/routes/theblockbeats/index.ts +10 -5
- package/lib/routes/towardsdatascience/latest.ts +67 -0
- package/lib/routes/towardsdatascience/namespace.ts +6 -0
- package/lib/routes/tvb/news.ts +1 -0
- package/lib/routes/twitter/api/index.ts +2 -0
- package/lib/routes/twitter/api/web-api/api.ts +18 -0
- package/lib/routes/twitter/api/web-api/constants.ts +2 -0
- package/lib/routes/twitter/api/web-api/login.ts +66 -0
- package/lib/routes/twitter/api/web-api/utils.ts +53 -27
- package/lib/routes/twitter/home-latest.ts +60 -0
- package/lib/routes/twitter/home.ts +1 -1
- package/lib/routes/twitter/user.ts +1 -1
- package/lib/routes/twitter/utils.ts +4 -1
- package/lib/routes/uber/blog.ts +1 -1
- package/lib/routes/ustc/scms.ts +97 -0
- package/lib/routes/v2ex/xna.ts +55 -0
- package/lib/routes/wchscu/namespace.ts +6 -0
- package/lib/routes/wchscu/recruit.ts +73 -0
- package/lib/routes/xiaohongshu/notes.ts +10 -2
- package/lib/routes/xiaohongshu/user.ts +23 -2
- package/lib/routes/xidian/cs.ts +143 -0
- package/lib/routes/xidian/gr.ts +289 -0
- package/lib/routes/xidian/jwc.ts +1 -0
- package/lib/routes/xidian/namespace.ts +1 -1
- package/lib/routes/yahoo/news/index.ts +1 -0
- package/lib/routes/yahoo/news/listid.ts +67 -0
- package/lib/routes/yahoo/news/utils.ts +8 -2
- package/lib/routes/yicai/carousel.ts +48 -0
- package/lib/routes/yicai/utils.ts +23 -17
- package/lib/routes/youtube/subscriptions.ts +1 -0
- package/lib/routes/yystv/docs.ts +28 -19
- package/lib/routes/zhihu/answers.ts +5 -1
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +2 -0
- package/lib/routes/zhihu/namespace.ts +3 -0
- package/lib/routes/zhihu/utils.ts +15 -2
- package/lib/routes/zsxq/types.ts +9 -0
- package/lib/routes/zsxq/utils.ts +4 -3
- package/lib/setup.test.ts +1 -1
- package/lib/types.ts +6 -0
- package/lib/utils/cache/index.ts +8 -0
- package/lib/utils/camelcase-keys.spec.ts +127 -0
- package/lib/utils/camelcase-keys.ts +27 -0
- package/lib/utils/common-utils.ts +1 -0
- package/lib/views/error.tsx +3 -3
- package/lib/views/index.tsx +4 -3
- package/lib/views/layout.tsx +1 -1
- package/package.json +46 -44
- package/lib/routes/sse/lawandrules.ts +0 -68
- package/lib/routes-deprecated/bjnews/news.js +0 -44
- package/lib/routes-deprecated/gamersky/ent.js +0 -89
- package/lib/routes-deprecated/gamersky/news.js +0 -34
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
|
|
3
|
+
import { load } from 'cheerio';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import cache from '@/utils/cache';
|
|
6
|
+
import ofetch from '@/utils/ofetch';
|
|
7
|
+
|
|
8
|
+
export const route: Route = {
|
|
9
|
+
path: '/',
|
|
10
|
+
categories: ['new-media'],
|
|
11
|
+
example: '/ftm',
|
|
12
|
+
parameters: {},
|
|
13
|
+
name: '文章',
|
|
14
|
+
maintainers: ['dzx-dzx'],
|
|
15
|
+
radar: [
|
|
16
|
+
{
|
|
17
|
+
source: ['www.ftm.eu'],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
handler,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
async function handler(ctx) {
|
|
24
|
+
const rootUrl = 'https://www.ftm.eu';
|
|
25
|
+
const currentUrl = `${rootUrl}/articles`;
|
|
26
|
+
const response = await ofetch(currentUrl);
|
|
27
|
+
|
|
28
|
+
const $ = load(response);
|
|
29
|
+
|
|
30
|
+
const list = $('.article-card')
|
|
31
|
+
.toArray()
|
|
32
|
+
.map((e) => ({ link: $(e).attr('href'), title: $(e).find('h2').text() }))
|
|
33
|
+
.slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : Infinity);
|
|
34
|
+
|
|
35
|
+
const items = await Promise.all(
|
|
36
|
+
list.map((item) =>
|
|
37
|
+
cache.tryGet(item.link, async () => {
|
|
38
|
+
const content = load(await ofetch(item.link));
|
|
39
|
+
const ldjson = JSON.parse(content('[type="application/ld+json"]:not([data-schema])').text());
|
|
40
|
+
|
|
41
|
+
item.pubDate = parseDate(ldjson.datePublished);
|
|
42
|
+
item.updated = parseDate(ldjson.dateModified);
|
|
43
|
+
|
|
44
|
+
item.author = content("[name='author']")
|
|
45
|
+
.toArray()
|
|
46
|
+
.map((e) => ({ name: $(e).attr('content') }));
|
|
47
|
+
item.category = content('.collection .tab').text().trim() || null;
|
|
48
|
+
|
|
49
|
+
item.description = content('.body').html();
|
|
50
|
+
|
|
51
|
+
return item;
|
|
52
|
+
})
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
return {
|
|
56
|
+
title: $('title').text(),
|
|
57
|
+
link: currentUrl,
|
|
58
|
+
item: items,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import { parseDate } from '@/utils/parse-date';
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
|
|
5
|
+
export const route: Route = {
|
|
6
|
+
path: '/quest/:alias',
|
|
7
|
+
name: 'Quest',
|
|
8
|
+
url: 'app.galxe.com',
|
|
9
|
+
maintainers: ['cxheng315'],
|
|
10
|
+
example: '/galxe/quest/MissionWeb3',
|
|
11
|
+
categories: ['other'],
|
|
12
|
+
features: {
|
|
13
|
+
requireConfig: false,
|
|
14
|
+
requirePuppeteer: false,
|
|
15
|
+
antiCrawler: false,
|
|
16
|
+
supportBT: false,
|
|
17
|
+
supportPodcast: false,
|
|
18
|
+
supportScihub: false,
|
|
19
|
+
},
|
|
20
|
+
radar: [
|
|
21
|
+
{
|
|
22
|
+
source: ['app.galxe.com/quest/:alias'],
|
|
23
|
+
target: '/quest/:alias',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
handler,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
async function handler(ctx) {
|
|
30
|
+
const url = 'https://graphigo.prd.galaxy.eco/query';
|
|
31
|
+
|
|
32
|
+
const alias = ctx.req.param('alias');
|
|
33
|
+
|
|
34
|
+
const response = await ofetch(url, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers: {
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
},
|
|
39
|
+
body: {
|
|
40
|
+
variables: {
|
|
41
|
+
alias,
|
|
42
|
+
campaignInput: {
|
|
43
|
+
first: ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50,
|
|
44
|
+
excludeChildren: true,
|
|
45
|
+
listType: 'Newest',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
query: `
|
|
49
|
+
query BrowseSpaceCampaigns($id: Int, $alias: String, $campaignInput: ListCampaignInput!) {
|
|
50
|
+
space(id: $id, alias: $alias) {
|
|
51
|
+
id
|
|
52
|
+
name
|
|
53
|
+
alias
|
|
54
|
+
info
|
|
55
|
+
campaigns(input: $campaignInput) {
|
|
56
|
+
list {
|
|
57
|
+
startTime
|
|
58
|
+
endTime
|
|
59
|
+
id
|
|
60
|
+
name
|
|
61
|
+
description
|
|
62
|
+
__typename
|
|
63
|
+
}
|
|
64
|
+
pageInfo {
|
|
65
|
+
endCursor
|
|
66
|
+
hasNextPage
|
|
67
|
+
__typename
|
|
68
|
+
}
|
|
69
|
+
__typename
|
|
70
|
+
}
|
|
71
|
+
__typename
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const space = response.data.space;
|
|
79
|
+
|
|
80
|
+
const items = space.campaigns.list.map((campaign) => ({
|
|
81
|
+
title: campaign.name,
|
|
82
|
+
link: `https://app.galxe.com/quest/${alias}/${campaign.id}`,
|
|
83
|
+
description: campaign.description,
|
|
84
|
+
pubDate: campaign.startTime ? parseDate(campaign.startTime * 1000) : null,
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
title: space.name,
|
|
89
|
+
description: space.info,
|
|
90
|
+
link: `https://app.galxe.com/quest/${alias}`,
|
|
91
|
+
item: items,
|
|
92
|
+
author: space.alias,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Route } from '@/types';
|
|
2
|
+
import type { Context } from 'hono';
|
|
3
|
+
import { getArticleList, parseArticleList, getArticle, mdTableBuilder } from './utils';
|
|
4
|
+
|
|
5
|
+
const idNameMap = new Map([
|
|
6
|
+
['all', { title: '热点图文', suffix: 'ent', nodeId: '20107' }],
|
|
7
|
+
['qw', { title: '趣囧时间', suffix: 'ent/qw', nodeId: '20113' }],
|
|
8
|
+
['movie', { title: '游民影院', suffix: 'wenku/movie', nodeId: '20111' }],
|
|
9
|
+
['discovery', { title: '游观天下', suffix: 'ent/discovery', nodeId: '20114' }],
|
|
10
|
+
['wp', { title: '壁纸图库', suffix: 'ent/wp', nodeId: '20117' }],
|
|
11
|
+
['wenku', { title: '游民盘点', suffix: 'wenku', nodeId: '20106' }],
|
|
12
|
+
['xz', { title: '游民福利', suffix: 'ent/xz', nodeId: '20119' }],
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
export const route: Route = {
|
|
16
|
+
path: '/ent/:category?',
|
|
17
|
+
categories: ['game'],
|
|
18
|
+
example: '/gamersky/ent/xz',
|
|
19
|
+
parameters: {
|
|
20
|
+
type: '分类类型,留空为 `all`',
|
|
21
|
+
},
|
|
22
|
+
features: {
|
|
23
|
+
requireConfig: false,
|
|
24
|
+
requirePuppeteer: false,
|
|
25
|
+
antiCrawler: false,
|
|
26
|
+
supportBT: false,
|
|
27
|
+
supportPodcast: false,
|
|
28
|
+
supportScihub: false,
|
|
29
|
+
},
|
|
30
|
+
radar: Object.entries(idNameMap).map(([type, { title, suffix }]) => ({
|
|
31
|
+
title,
|
|
32
|
+
source: [`www.gamersky.com/${suffix}`],
|
|
33
|
+
target: `/ent/${type}`,
|
|
34
|
+
})),
|
|
35
|
+
name: '娱乐',
|
|
36
|
+
maintainers: ['LogicJake'],
|
|
37
|
+
description: mdTableBuilder(Object.entries(idNameMap).map(([type, { title, nodeId }]) => ({ type, name: title, nodeId }))),
|
|
38
|
+
handler,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
async function handler(ctx: Context) {
|
|
42
|
+
const category = ctx.req.param('category') ?? 'all';
|
|
43
|
+
|
|
44
|
+
const idName = idNameMap.get(category);
|
|
45
|
+
if (!idName) {
|
|
46
|
+
throw new Error(`Invalid type: ${category}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const response = await getArticleList(idName.nodeId);
|
|
50
|
+
const list = parseArticleList(response);
|
|
51
|
+
const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
|
|
52
|
+
return {
|
|
53
|
+
title: `${idName.title} - 游民娱乐`,
|
|
54
|
+
link: `https://www.gamersky.com/${idName.suffix}`,
|
|
55
|
+
item: fullTextList,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Route } from '@/types';
|
|
2
|
+
import type { Context } from 'hono';
|
|
3
|
+
import { getArticleList, parseArticleList, getArticle, mdTableBuilder } from './utils';
|
|
4
|
+
|
|
5
|
+
const idNameMap = [
|
|
6
|
+
{
|
|
7
|
+
type: 'today',
|
|
8
|
+
name: '今日推荐',
|
|
9
|
+
nodeId: '11007',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: '单机电玩',
|
|
13
|
+
type: 'pc',
|
|
14
|
+
nodeId: '129',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'NS',
|
|
18
|
+
type: 'ns',
|
|
19
|
+
nodeId: '21160',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: '手游',
|
|
23
|
+
type: 'mobile',
|
|
24
|
+
nodeId: '20260',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: '网游',
|
|
28
|
+
type: 'web',
|
|
29
|
+
nodeId: '20225',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: '业界',
|
|
33
|
+
type: 'industry',
|
|
34
|
+
nodeId: '21163',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: '硬件',
|
|
38
|
+
type: 'hardware',
|
|
39
|
+
nodeId: '20070',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: '科技',
|
|
43
|
+
type: 'tech',
|
|
44
|
+
nodeId: '20547',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export const route: Route = {
|
|
49
|
+
path: '/news/:type?',
|
|
50
|
+
categories: ['game'],
|
|
51
|
+
example: '/gamersky/news/pc',
|
|
52
|
+
parameters: {
|
|
53
|
+
type: '资讯类型,见表,默认为 `pc`',
|
|
54
|
+
},
|
|
55
|
+
features: {
|
|
56
|
+
requireConfig: false,
|
|
57
|
+
requirePuppeteer: false,
|
|
58
|
+
antiCrawler: false,
|
|
59
|
+
supportBT: false,
|
|
60
|
+
supportPodcast: false,
|
|
61
|
+
supportScihub: false,
|
|
62
|
+
},
|
|
63
|
+
radar: [
|
|
64
|
+
{
|
|
65
|
+
source: ['www.gamersky.com/news'],
|
|
66
|
+
target: '/news',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
name: '资讯',
|
|
70
|
+
maintainers: ['yy4382'],
|
|
71
|
+
description: mdTableBuilder(idNameMap),
|
|
72
|
+
handler,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
async function handler(ctx: Context) {
|
|
76
|
+
const type = ctx.req.param('type') ?? 'pc';
|
|
77
|
+
|
|
78
|
+
const idName = idNameMap.find((item) => item.type === type);
|
|
79
|
+
if (!idName) {
|
|
80
|
+
throw new Error(`Invalid type: ${type}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const response = await getArticleList(idName.nodeId);
|
|
84
|
+
const list = parseArticleList(response);
|
|
85
|
+
const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
|
|
86
|
+
return {
|
|
87
|
+
title: `${idName.name} - 游民星空`,
|
|
88
|
+
link: 'https://www.gamersky.com/news',
|
|
89
|
+
item: fullTextList,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Route } from '@/types';
|
|
2
|
+
import type { Context } from 'hono';
|
|
3
|
+
import { getArticleList, parseArticleList, getArticle, mdTableBuilder } from './utils';
|
|
4
|
+
const idNameMap = [
|
|
5
|
+
{
|
|
6
|
+
type: 'pc',
|
|
7
|
+
name: '单机',
|
|
8
|
+
nodeId: '20465',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
type: 'tv',
|
|
12
|
+
name: '电视',
|
|
13
|
+
nodeId: '20466',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'indie',
|
|
17
|
+
name: '独立游戏',
|
|
18
|
+
nodeId: '20922',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'web',
|
|
22
|
+
name: '网游',
|
|
23
|
+
nodeId: '20916',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'mobile',
|
|
27
|
+
name: '手游',
|
|
28
|
+
nodeId: '20917',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'all',
|
|
32
|
+
name: '全部评测',
|
|
33
|
+
nodeId: '20915',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export const route: Route = {
|
|
38
|
+
path: '/review/:type?',
|
|
39
|
+
categories: ['game'],
|
|
40
|
+
example: '/gamersky/review/pc',
|
|
41
|
+
parameters: {
|
|
42
|
+
type: '评测类型,可选值为 `pc`、`tv`、`indie`、`web`、`mobile`、`all`,默认为 `pc`',
|
|
43
|
+
},
|
|
44
|
+
features: {
|
|
45
|
+
requireConfig: false,
|
|
46
|
+
requirePuppeteer: false,
|
|
47
|
+
antiCrawler: false,
|
|
48
|
+
supportBT: false,
|
|
49
|
+
supportPodcast: false,
|
|
50
|
+
supportScihub: false,
|
|
51
|
+
},
|
|
52
|
+
radar: [
|
|
53
|
+
{
|
|
54
|
+
source: ['www.gamersky.com/review'],
|
|
55
|
+
target: '/review',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
name: '评测',
|
|
59
|
+
maintainers: ['yy4382'],
|
|
60
|
+
description: mdTableBuilder(idNameMap),
|
|
61
|
+
handler,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
async function handler(ctx: Context) {
|
|
65
|
+
const type = ctx.req.param('type') ?? 'pc';
|
|
66
|
+
|
|
67
|
+
const idName = idNameMap.find((item) => item.type === type);
|
|
68
|
+
if (!idName) {
|
|
69
|
+
throw new Error(`Invalid type: ${type}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const response = await getArticleList(idName.nodeId);
|
|
73
|
+
const list = parseArticleList(response);
|
|
74
|
+
const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
|
|
75
|
+
return {
|
|
76
|
+
title: `${idName.name} - 游民星空评测`,
|
|
77
|
+
link: 'https://www.gamersky.com/review',
|
|
78
|
+
item: fullTextList,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { DataItem } from '@/types';
|
|
2
|
+
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
import { load } from 'cheerio';
|
|
5
|
+
import cache from '@/utils/cache';
|
|
6
|
+
import { parseDate } from '@/utils/parse-date';
|
|
7
|
+
import timezone from '@/utils/timezone';
|
|
8
|
+
|
|
9
|
+
interface idNameMap {
|
|
10
|
+
type: string;
|
|
11
|
+
name: string;
|
|
12
|
+
nodeId: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
}
|
|
15
|
+
interface ArticleList {
|
|
16
|
+
status: string;
|
|
17
|
+
totalPages: number;
|
|
18
|
+
body: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const getArticleList = async (nodeId) => {
|
|
22
|
+
const response = await ofetch<ArticleList>(
|
|
23
|
+
`https://db2.gamersky.com/LabelJsonpAjax.aspx?${new URLSearchParams({
|
|
24
|
+
jsondata: JSON.stringify({
|
|
25
|
+
type: 'updatenodelabel',
|
|
26
|
+
isCache: true,
|
|
27
|
+
cacheTime: 60,
|
|
28
|
+
nodeId,
|
|
29
|
+
isNodeId: 'true',
|
|
30
|
+
page: 1,
|
|
31
|
+
}),
|
|
32
|
+
})}`,
|
|
33
|
+
{
|
|
34
|
+
parseResponse: (txt) => JSON.parse(txt.match(/\((.+)\);/)?.[1] ?? '{}'),
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
return response.body;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const parseArticleList = (response: string) => {
|
|
41
|
+
const $ = load(response);
|
|
42
|
+
return $('li')
|
|
43
|
+
.toArray()
|
|
44
|
+
.map((item) => {
|
|
45
|
+
const ele = $(item);
|
|
46
|
+
const a = ele.find('.tt').length ? ele.find('.tt') : ele.find('a');
|
|
47
|
+
const title = a.text();
|
|
48
|
+
const link = a.attr('href');
|
|
49
|
+
const pubDate = timezone(parseDate(ele.find('.time').text()), 8);
|
|
50
|
+
const description = ele.find('.txt').text();
|
|
51
|
+
if (!link) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
title,
|
|
56
|
+
link,
|
|
57
|
+
pubDate,
|
|
58
|
+
description,
|
|
59
|
+
};
|
|
60
|
+
})
|
|
61
|
+
.filter((item) => item !== undefined) satisfies DataItem[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const getArticle = (item) =>
|
|
65
|
+
cache.tryGet(item.link, async () => {
|
|
66
|
+
const response = await ofetch(item.link);
|
|
67
|
+
const $ = load(response);
|
|
68
|
+
const content = $('.Mid2L_con, .MidLcon');
|
|
69
|
+
content.find('.appGameBuyCardIframe, .GSAppButton, .Mid2L_down').remove();
|
|
70
|
+
content.find('a').each((_, item) => {
|
|
71
|
+
if (item.attribs.href?.startsWith('https://www.gamersky.com/showimage/id_gamersky.shtml?')) {
|
|
72
|
+
item.attribs.href = item.attribs.href.replace('https://www.gamersky.com/showimage/id_gamersky.shtml?', '');
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
content.find('img').each((_, item) => {
|
|
76
|
+
if (item.attribs.src === 'http://image.gamersky.com/webimg13/zhuanti/common/blank.png') {
|
|
77
|
+
item.attribs.src = item.attribs['data-origin'];
|
|
78
|
+
} else if (item.attribs.src.endsWith('_S.jpg')) {
|
|
79
|
+
item.attribs.src = item.attribs.src.replace('_S.jpg', '.jpg');
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
content.find('.Slides li').each((_, item) => {
|
|
83
|
+
if (item.attribs.style === 'display: none;') {
|
|
84
|
+
item.attribs.style = 'display: list-item;';
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
item.description = content.html() || item.description;
|
|
88
|
+
return item satisfies DataItem;
|
|
89
|
+
}) as Promise<DataItem>;
|
|
90
|
+
|
|
91
|
+
export function mdTableBuilder(data: idNameMap[]) {
|
|
92
|
+
const table = '|' + data.map((item) => `${item.type}|`).join('') + '\n|' + Array(data.length).fill('---|').join('') + '\n|' + data.map((item) => `${item.name}|`).join('') + '\n';
|
|
93
|
+
return table;
|
|
94
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
2
|
import cache from '@/utils/cache';
|
|
3
3
|
import got from '@/utils/got';
|
|
4
|
-
import wait from '@/utils/wait';
|
|
5
4
|
import { load } from 'cheerio';
|
|
6
5
|
import { CookieJar } from 'tough-cookie';
|
|
7
6
|
import { parseDate } from '@/utils/parse-date';
|
|
@@ -81,7 +80,7 @@ export const route: Route = {
|
|
|
81
80
|
},
|
|
82
81
|
],
|
|
83
82
|
name: 'Unknown',
|
|
84
|
-
maintainers: ['
|
|
83
|
+
maintainers: ['jim-kirisame'],
|
|
85
84
|
handler,
|
|
86
85
|
url: 'oas.gdut.edu.cn/seeyon',
|
|
87
86
|
};
|
|
@@ -115,18 +114,16 @@ async function handler(ctx) {
|
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
// 构造文章数组
|
|
118
|
-
const articles =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
category: item.typeName,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
117
|
+
const articles = resp.data.list.map((item) => ({
|
|
118
|
+
title: item.title,
|
|
119
|
+
guid: item.id,
|
|
120
|
+
link: site + '/newsData.do?method=newsView&newsId=' + item.id,
|
|
121
|
+
pubDate: timezone(parseDate(item.publishDate1), +8),
|
|
122
|
+
author: item.publishUserDepart,
|
|
123
|
+
category: item.typeName,
|
|
124
|
+
}));
|
|
129
125
|
|
|
126
|
+
const results = [];
|
|
130
127
|
// 获取实际的文章内容
|
|
131
128
|
for await (const data of asyncPool(2, articles, async (data) => {
|
|
132
129
|
const link = data.link;
|
|
@@ -209,18 +206,16 @@ async function handler(ctx) {
|
|
|
209
206
|
}
|
|
210
207
|
});
|
|
211
208
|
|
|
212
|
-
// 防止太快被Ban
|
|
213
|
-
await wait(500);
|
|
214
209
|
return node.html();
|
|
215
210
|
});
|
|
216
211
|
})) {
|
|
217
|
-
data;
|
|
212
|
+
results.push(data);
|
|
218
213
|
}
|
|
219
214
|
|
|
220
215
|
return {
|
|
221
216
|
title: `广东工业大学新闻通知网 - ` + type.name,
|
|
222
217
|
link: site,
|
|
223
218
|
description: `广东工业大学新闻通知网`,
|
|
224
|
-
item:
|
|
219
|
+
item: results,
|
|
225
220
|
};
|
|
226
221
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
|
|
3
|
+
import { load } from 'cheerio';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import cache from '@/utils/cache';
|
|
6
|
+
import ofetch from '@/utils/ofetch';
|
|
7
|
+
|
|
8
|
+
export const route: Route = {
|
|
9
|
+
path: '/:path{.*}',
|
|
10
|
+
categories: ['new-media'],
|
|
11
|
+
example: '/gis/c/security-challenges/',
|
|
12
|
+
parameters: { path: '包含"Reports"页面下的路径' },
|
|
13
|
+
name: '报告',
|
|
14
|
+
maintainers: ['dzx-dzx'],
|
|
15
|
+
radar: [
|
|
16
|
+
{
|
|
17
|
+
source: ['www.gisreportsonline.com'],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
handler,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
async function handler(ctx) {
|
|
24
|
+
const rootUrl = 'https://www.gisreportsonline.com';
|
|
25
|
+
const currentUrl = `${rootUrl}/${ctx.req.param('path')}`;
|
|
26
|
+
const response = await ofetch(currentUrl);
|
|
27
|
+
|
|
28
|
+
const $ = load(response);
|
|
29
|
+
|
|
30
|
+
const list = $('article h3 a')
|
|
31
|
+
.toArray()
|
|
32
|
+
.map((e) => ({ link: $(e).attr('href'), title: $(e).text() }));
|
|
33
|
+
|
|
34
|
+
const items = await Promise.all(
|
|
35
|
+
list.map((item) =>
|
|
36
|
+
cache.tryGet(item.link, async () => {
|
|
37
|
+
const content = load(await ofetch(item.link));
|
|
38
|
+
const ldjson = JSON.parse(content('script.rank-math-schema-pro').text())['@graph'].find((e) => e['@type'] === 'NewsArticle');
|
|
39
|
+
|
|
40
|
+
item.pubDate = parseDate(ldjson.datePublished);
|
|
41
|
+
item.updated = parseDate(ldjson.dateModified);
|
|
42
|
+
item.author = [ldjson.author];
|
|
43
|
+
item.category = ldjson.keywords.split(',');
|
|
44
|
+
item.language = ldjson.inLanguage;
|
|
45
|
+
|
|
46
|
+
item.description = content('header.entry-header ~ :not(#pos-conclusion ~ *)')
|
|
47
|
+
.toArray()
|
|
48
|
+
.map((e) => content(e).prop('outerHTML'))
|
|
49
|
+
.join('');
|
|
50
|
+
|
|
51
|
+
return item;
|
|
52
|
+
})
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
return {
|
|
56
|
+
title: $('title').text(),
|
|
57
|
+
link: currentUrl,
|
|
58
|
+
item: items,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -2,6 +2,7 @@ import { Route, ViewType } from '@/types';
|
|
|
2
2
|
import ofetch from '@/utils/ofetch';
|
|
3
3
|
import { parseDate } from '@/utils/parse-date';
|
|
4
4
|
import Parser from 'rss-parser';
|
|
5
|
+
import sanitizeHtml from 'sanitize-html';
|
|
5
6
|
|
|
6
7
|
const parser = new Parser();
|
|
7
8
|
|
|
@@ -38,16 +39,16 @@ export const route: Route = {
|
|
|
38
39
|
const image = raw.match(/<media:thumbnail height="30" width="30" url="(.+?)"/)?.[1];
|
|
39
40
|
const feed = await parser.parseString(raw);
|
|
40
41
|
return {
|
|
41
|
-
title: `${user}'s GitHub
|
|
42
|
+
title: `${user}'s GitHub activities`,
|
|
42
43
|
link: feed.link,
|
|
43
44
|
image,
|
|
44
45
|
item: feed.items.map((item) => ({
|
|
45
46
|
title: item.title ?? '',
|
|
46
47
|
link: item.link,
|
|
47
|
-
description: item.content?.replace(/href="(.+?)"/g, `href="https://github.com$1"`),
|
|
48
|
+
description: sanitizeHtml(item.content?.replace(/href="(.+?)"/g, `href="https://github.com$1"`) ?? '', { allowedTags: [...sanitizeHtml.defaults.allowedTags, 'img'] }),
|
|
48
49
|
pubDate: item.pubDate ? parseDate(item.pubDate) : undefined,
|
|
49
50
|
author: item.author,
|
|
50
|
-
|
|
51
|
+
guid: item.id,
|
|
51
52
|
image,
|
|
52
53
|
})),
|
|
53
54
|
};
|