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
package/lib/routes/hket/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Route } from '@/types';
|
|
1
|
+
import { DataItem, Route } from '@/types';
|
|
2
2
|
import { getCurrentPath } from '@/utils/helpers';
|
|
3
3
|
const __dirname = getCurrentPath(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import cache from '@/utils/cache';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import ofetch from '@/utils/ofetch';
|
|
7
|
+
import * as cheerio from 'cheerio';
|
|
8
8
|
import { parseDate } from '@/utils/parse-date';
|
|
9
9
|
import timezone from '@/utils/timezone';
|
|
10
10
|
import path from 'node:path';
|
|
@@ -39,9 +39,13 @@ export const route: Route = {
|
|
|
39
39
|
supportScihub: false,
|
|
40
40
|
},
|
|
41
41
|
radar: [
|
|
42
|
+
{
|
|
43
|
+
source: ['china.hket.com/:category/*', 'inews.hket.com/:category/*', 'topick.hket.com/:category/*', 'wealth.hket.com/:category/*'],
|
|
44
|
+
target: '/:category',
|
|
45
|
+
},
|
|
42
46
|
{
|
|
43
47
|
source: ['www.hket.com/'],
|
|
44
|
-
target: '',
|
|
48
|
+
target: '/',
|
|
45
49
|
},
|
|
46
50
|
],
|
|
47
51
|
name: '新闻',
|
|
@@ -55,57 +59,57 @@ export const route: Route = {
|
|
|
55
59
|
<details>
|
|
56
60
|
<summary>分类</summary>
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
| sran001 | sran008 | sran010 | sran011 | sran012 | srat006 |
|
|
63
|
+
| -------- | -------- | -------- | -------- | -------- | -------- |
|
|
64
|
+
| 全部新闻 | 财经地产 | 科技信息 | 国际新闻 | 商业新闻 | 香港新闻 |
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
| sran009 | sran009-1 | sran009-2 | sran009-3 | sran009-4 | sran009-5 | sran009-6 |
|
|
67
|
+
| -------- | --------- | --------- | ---------- | --------- | --------- | --------- |
|
|
68
|
+
| 即时财经 | 股市 | 新股 IPO | 新经济追踪 | 当炒股 | 宏观解读 | Hot Talk |
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
| sran011-1 | sran011-2 | sran011-3 |
|
|
71
|
+
| --------- | ------------ | ------------ |
|
|
72
|
+
| 环球政治 | 环球经济金融 | 环球社会热点 |
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
| sran016 | sran016-1 | sran016-2 | sran016-3 | sran016-4 | sran016-5 |
|
|
75
|
+
| ---------- | ---------- | ---------- | ---------- | ---------- | -------------- |
|
|
76
|
+
| 大湾区主页 | 大湾区发展 | 大湾区工作 | 大湾区买楼 | 大湾区消费 | 大湾区投资理财 |
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
| srac002 | srac003 | srac004 | srac005 |
|
|
79
|
+
| -------- | -------- | -------- | -------- |
|
|
80
|
+
| 即时中国 | 经济脉搏 | 国情动向 | 社会热点 |
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
| srat001 | srat008 | srat055 | srat069 | srat070 |
|
|
83
|
+
| ------- | ------- | -------- | -------- | --------- |
|
|
84
|
+
| 话题 | 观点 | 休闲消费 | 娱乐新闻 | TOPick TV |
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
| srat052 | srat052-1 | srat052-2 | srat052-3 |
|
|
87
|
+
| -------- | --------- | ---------- | --------- |
|
|
88
|
+
| 健康主页 | 食用安全 | 医生诊症室 | 保健美颜 |
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
| srat053 | srat053-1 | srat053-2 | srat053-3 | srat053-4 |
|
|
91
|
+
| -------- | --------- | --------- | --------- | ---------- |
|
|
92
|
+
| 亲子主页 | 儿童健康 | 育儿经 | 教育 | 亲子好去处 |
|
|
89
93
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
| srat053-6 | srat053-61 | srat053-62 | srat053-63 | srat053-64 |
|
|
95
|
+
| ----------- | ---------- | ---------- | ---------- | ---------- |
|
|
96
|
+
| Band 1 学堂 | 幼稚园 | 中小学 | 尖子教室 | 海外升学 |
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
| srat072-1 | srat072-2 | srat072-3 | srat072-4 |
|
|
99
|
+
| ---------- | ---------- | ---------------- | ----------------- |
|
|
100
|
+
| 健康身心活 | 抗癌新方向 | 「糖」「心」解密 | 风湿不再 你我自在 |
|
|
97
101
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
| sraw007 | sraw009 | sraw010 | sraw011 | sraw012 | sraw014 | sraw018 | sraw019 |
|
|
103
|
+
| -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
|
104
|
+
| 全部博客 | Bloggers | 收息攻略 | 精明消费 | 退休规划 | 个人增值 | 财富管理 | 绿色金融 |
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
| sraw015 | sraw015-07 | sraw015-08 | sraw015-09 | sraw015-10 |
|
|
107
|
+
| -------- | ---------- | ---------- | ---------- | ---------- |
|
|
108
|
+
| 移民百科 | 海外置业 | 移民攻略 | 移民点滴 | 海外理财 |
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
| sraw020 | sraw020-1 | sraw020-2 | sraw020-3 | sraw020-4 |
|
|
111
|
+
| -------- | ------------ | --------- | --------- | --------- |
|
|
112
|
+
| ESG 主页 | ESG 趋势政策 | ESG 投资 | ESG 企业 | ESG 社会 |
|
|
109
113
|
</details>`,
|
|
110
114
|
};
|
|
111
115
|
|
|
@@ -113,49 +117,45 @@ async function handler(ctx) {
|
|
|
113
117
|
const { category = 'sran001' } = ctx.req.param();
|
|
114
118
|
const baseUrl = urlMap[category.substring(0, 4)].baseUrl;
|
|
115
119
|
|
|
116
|
-
const
|
|
120
|
+
const response = await ofetch(`${baseUrl}/${category}`);
|
|
117
121
|
|
|
118
|
-
const $ = load(response);
|
|
122
|
+
const $ = cheerio.load(response);
|
|
119
123
|
|
|
120
124
|
const list = $('div.listing-title > a')
|
|
121
125
|
.toArray()
|
|
122
126
|
.map((item) => {
|
|
123
127
|
item = $(item);
|
|
128
|
+
const url = item.parent().parent().find('.share-button').data('url');
|
|
124
129
|
return {
|
|
125
130
|
title: item.text().trim(),
|
|
126
|
-
link:
|
|
127
|
-
? // remove tracking parameters
|
|
128
|
-
baseUrl + item.attr('href').split('?')[0].substring(0, item.attr('href').lastIndexOf('/'))
|
|
129
|
-
: item.attr('href').split('?')[0].substring(0, item.attr('href').lastIndexOf('/')),
|
|
131
|
+
link: url.startsWith('http') ? url : baseUrl + url,
|
|
130
132
|
};
|
|
131
|
-
});
|
|
133
|
+
}) as DataItem[];
|
|
132
134
|
|
|
133
135
|
const items = await Promise.all(
|
|
134
136
|
list.map((item) =>
|
|
135
|
-
cache.tryGet(item.link
|
|
136
|
-
if (item.link
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
data = await (item.link.startsWith('https://invest.hket.com/')
|
|
140
|
-
? got.post('https://invest.hket.com/content-api-middleware/content', {
|
|
137
|
+
cache.tryGet(item.link!, async () => {
|
|
138
|
+
if (item.link!.startsWith('https://invest.hket.com/') || item.link!.startsWith('https://ps.hket.com/')) {
|
|
139
|
+
const data = await (item.link!.startsWith('https://invest.hket.com/')
|
|
140
|
+
? ofetch('https://invest.hket.com/content-api-middleware/content', {
|
|
141
141
|
headers: {
|
|
142
|
-
referer: item.link
|
|
142
|
+
referer: item.link!,
|
|
143
143
|
},
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
method: 'POST',
|
|
145
|
+
body: {
|
|
146
|
+
id: item.link!.split('/').pop(),
|
|
146
147
|
channel: 'invest',
|
|
147
148
|
},
|
|
148
149
|
})
|
|
149
|
-
:
|
|
150
|
+
: ofetch('https://data02.hket.com/content', {
|
|
150
151
|
headers: {
|
|
151
|
-
referer: item.link
|
|
152
|
+
referer: item.link!,
|
|
152
153
|
},
|
|
153
|
-
|
|
154
|
-
id: item.link
|
|
154
|
+
query: {
|
|
155
|
+
id: item.link!.split('/').pop(),
|
|
155
156
|
channel: 'epc',
|
|
156
157
|
},
|
|
157
158
|
}));
|
|
158
|
-
data = data.data;
|
|
159
159
|
|
|
160
160
|
item.pubDate = timezone(parseDate(data.displayDate), +8);
|
|
161
161
|
item.updated = timezone(parseDate(data.lastModifiedDate), +8);
|
|
@@ -166,8 +166,8 @@ async function handler(ctx) {
|
|
|
166
166
|
return item;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
const
|
|
170
|
-
const $ = load(response);
|
|
169
|
+
const response = await ofetch(item.link!);
|
|
170
|
+
const $ = cheerio.load(response);
|
|
171
171
|
|
|
172
172
|
item.category = $('.contentTags-container > .hotkey-container-wrapper > .hotkey-container > a')
|
|
173
173
|
.toArray()
|
|
@@ -194,28 +194,32 @@ async function handler(ctx) {
|
|
|
194
194
|
e = $(e);
|
|
195
195
|
e.replaceWith(
|
|
196
196
|
art(path.join(__dirname, 'templates/image.art'), {
|
|
197
|
-
alt: e.
|
|
198
|
-
src: e.
|
|
197
|
+
alt: e.data('alt'),
|
|
198
|
+
src: e.data('src') ?? e.attr('src'),
|
|
199
199
|
})
|
|
200
200
|
);
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
const ldJson = JSON.parse(
|
|
204
|
+
$('script[type="application/ld+json"]')
|
|
205
|
+
.toArray()
|
|
206
|
+
.find((e) => $(e).text().includes('NewsArticle'))?.children[0].data
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
item.description = $('div.article-detail-body-container').html()!;
|
|
210
|
+
item.pubDate = parseDate(ldJson.datePublished);
|
|
211
|
+
item.updated = parseDate(ldJson.dateModified);
|
|
205
212
|
|
|
206
213
|
return item;
|
|
207
214
|
})
|
|
208
215
|
)
|
|
209
216
|
);
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
title: $('head meta[name=title]').attr('content')
|
|
218
|
+
return {
|
|
219
|
+
title: $('head meta[name=title]').attr('content')?.trim(),
|
|
213
220
|
link: baseUrl + '/' + category,
|
|
214
|
-
description: $('head meta[name=description]').attr('content')
|
|
221
|
+
description: $('head meta[name=description]').attr('content')?.trim(),
|
|
215
222
|
item: items,
|
|
216
223
|
language: 'zh-hk',
|
|
217
224
|
};
|
|
218
|
-
|
|
219
|
-
ctx.set('json', ret);
|
|
220
|
-
return ret;
|
|
221
225
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import { load } from 'cheerio';
|
|
3
|
+
import puppeteer from '@/utils/puppeteer';
|
|
4
|
+
|
|
5
|
+
export const route: Route = {
|
|
6
|
+
path: '/',
|
|
7
|
+
categories: ['shopping'],
|
|
8
|
+
example: '/hottoys',
|
|
9
|
+
radar: [
|
|
10
|
+
{
|
|
11
|
+
source: ['hottoys.com.hk/'],
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
name: 'Toys List',
|
|
15
|
+
maintainers: ['jw0903'],
|
|
16
|
+
handler,
|
|
17
|
+
url: 'hottoys.com.hk/',
|
|
18
|
+
features: {
|
|
19
|
+
requirePuppeteer: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
async function handler() {
|
|
24
|
+
const baseUrl = 'https://www.hottoys.com.hk';
|
|
25
|
+
|
|
26
|
+
// 导入 puppeteer 工具类并初始化浏览器实例
|
|
27
|
+
const browser = await puppeteer();
|
|
28
|
+
// 打开一个新标签页
|
|
29
|
+
const page = await browser.newPage();
|
|
30
|
+
// 拦截所有请求
|
|
31
|
+
await page.setRequestInterception(true);
|
|
32
|
+
|
|
33
|
+
page.on('request', (request) => {
|
|
34
|
+
// 在这次例子,我们只允许 HTML 请求
|
|
35
|
+
request.resourceType() === 'document' ? request.continue() : request.abort();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
await page.goto(baseUrl, {
|
|
39
|
+
waitUntil: 'domcontentloaded',
|
|
40
|
+
});
|
|
41
|
+
const response = await page.content();
|
|
42
|
+
page.close();
|
|
43
|
+
const $ = load(response);
|
|
44
|
+
const items = $('li.productListItem')
|
|
45
|
+
.toArray()
|
|
46
|
+
.map((item) => {
|
|
47
|
+
const dom = $(item);
|
|
48
|
+
const a = dom.find('a').first();
|
|
49
|
+
const img = dom.find('img').first();
|
|
50
|
+
return {
|
|
51
|
+
title: img.attr('title') ?? 'hottoys',
|
|
52
|
+
link: `${baseUrl}/${a.attr('href')}`,
|
|
53
|
+
description: `<img src="${baseUrl}${img.attr('src')}" />`,
|
|
54
|
+
guid: a.attr('href'),
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
browser.close();
|
|
58
|
+
return {
|
|
59
|
+
title: 'Hot Toys New Products',
|
|
60
|
+
link: baseUrl,
|
|
61
|
+
item: items,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
|
|
3
|
+
import cache from '@/utils/cache';
|
|
4
|
+
import got from '@/utils/got';
|
|
5
|
+
import { load } from 'cheerio';
|
|
6
|
+
import { parseDate } from '@/utils/parse-date';
|
|
7
|
+
|
|
8
|
+
export const handler = async (ctx) => {
|
|
9
|
+
const { category = 'xwdt' } = ctx.req.param();
|
|
10
|
+
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 16;
|
|
11
|
+
|
|
12
|
+
const rootUrl = 'https://gs.hust.edu.cn';
|
|
13
|
+
const currentUrl = new URL(`${category}.htm`, rootUrl).href;
|
|
14
|
+
|
|
15
|
+
const { data: response } = await got(currentUrl);
|
|
16
|
+
|
|
17
|
+
const $ = load(response);
|
|
18
|
+
|
|
19
|
+
let items = $('div.btlist ul li')
|
|
20
|
+
.slice(0, limit)
|
|
21
|
+
.toArray()
|
|
22
|
+
.map((item) => {
|
|
23
|
+
item = $(item);
|
|
24
|
+
|
|
25
|
+
const a = item.find('a');
|
|
26
|
+
const link = a.prop('href');
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
title: a.text(),
|
|
30
|
+
pubDate: parseDate(item.find('span.time').text()),
|
|
31
|
+
link: link.startsWith('http') ? link : new URL(link, rootUrl).href,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
items = await Promise.all(
|
|
36
|
+
items.map((item) =>
|
|
37
|
+
cache.tryGet(item.link, async () => {
|
|
38
|
+
try {
|
|
39
|
+
const { data: detailResponse } = await got(item.link);
|
|
40
|
+
|
|
41
|
+
const $$ = load(detailResponse);
|
|
42
|
+
|
|
43
|
+
const description = $$('div.v_news_content').html();
|
|
44
|
+
|
|
45
|
+
item.title = $$('div.article_title h1, h5').text();
|
|
46
|
+
item.description = description;
|
|
47
|
+
item.content = {
|
|
48
|
+
html: description,
|
|
49
|
+
text: $$('div.v_news_content').text(),
|
|
50
|
+
};
|
|
51
|
+
} catch {
|
|
52
|
+
// no-empty
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return item;
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const image = new URL($('div.logo img').prop('content'), rootUrl).href;
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
title: $('title').text(),
|
|
64
|
+
description: $('META[Name="keywords"]').prop('Content'),
|
|
65
|
+
link: currentUrl,
|
|
66
|
+
item: items,
|
|
67
|
+
allowEmpty: true,
|
|
68
|
+
image,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const route: Route = {
|
|
73
|
+
path: '/gs/:category{.+}?',
|
|
74
|
+
name: '研究生院',
|
|
75
|
+
url: 'gs.hust.edu.cn',
|
|
76
|
+
maintainers: ['nczitzk'],
|
|
77
|
+
handler,
|
|
78
|
+
example: '/hust/gs/xwdt',
|
|
79
|
+
parameters: { category: '分类,默认为新闻动态,即 `xwdt`,可在对应分类页 URL 中找到' },
|
|
80
|
+
description: `:::tip
|
|
81
|
+
若订阅 [新闻动态](https://gs.hust.edu.cn/xwdt.htm),网址为 \`https://gs.hust.edu.cn/xwdt.htm\`。截取 \`https://gs.hust.edu.cn/\` 到末尾 \`.htm\` 的部分 \`xwdt\` 作为参数填入,此时路由为 [\`/hust/gs/xwdt\`](https://rsshub.app/hust/gs/xwdt)。
|
|
82
|
+
:::
|
|
83
|
+
|
|
84
|
+
| [新闻动态](https://gs.hust.edu.cn/xwdt.htm) | [研究生服务专区](https://gs.hust.edu.cn/yjsfwzq.htm) | [综合管理](https://gs.hust.edu.cn/gzzd/zhgl.htm) |
|
|
85
|
+
| ------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------- |
|
|
86
|
+
| [xwdt](https://rsshub.app/hust/gs/xwdt) | [yjsfwzq](https://rsshub.app/hust/gs/yjsfwzq) | [gzzd/zhgl](https://rsshub.app/hust/gs/gzzd/zhgl) |
|
|
87
|
+
|
|
88
|
+
#### [通知公告](https://gs.hust.edu.cn/tzgg/kcjksap.htm)
|
|
89
|
+
|
|
90
|
+
| [课程及考试安排](https://gs.hust.edu.cn/tzgg/kcjksap.htm) | [国际交流](https://gs.hust.edu.cn/tzgg/gjjl.htm) | [学位工作](https://gs.hust.edu.cn/tzgg/xwgz.htm) | [同济医学院](https://gs.hust.edu.cn/tzgg/tjyxy.htm) | [其他](https://gs.hust.edu.cn/tzgg/qt.htm) |
|
|
91
|
+
| --------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------- | --------------------------------------------- |
|
|
92
|
+
| [tzgg/kcjksap](https://rsshub.app/hust/gs/tzgg/kcjksap) | [tzgg/gjjl](https://rsshub.app/hust/gs/tzgg/gjjl) | [tzgg/xwgz](https://rsshub.app/hust/gs/tzgg/xwgz) | [tzgg/tjyxy](https://rsshub.app/hust/gs/tzgg/tjyxy) | [tzgg/qt](https://rsshub.app/hust/gs/tzgg/qt) |
|
|
93
|
+
|
|
94
|
+
#### [学籍管理](https://gs.hust.edu.cn/pygz/zbjs1/xjyd.htm)
|
|
95
|
+
|
|
96
|
+
| [学籍异动](https://gs.hust.edu.cn/pygz/zbjs1/xjyd.htm) | [毕业管理](https://gs.hust.edu.cn/pygz/zbjs1/bygl.htm) |
|
|
97
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
98
|
+
| [pygz/zbjs1/xjyd](https://rsshub.app/hust/gs/pygz/zbjs1/xjyd) | [pygz/zbjs1/bygl](https://rsshub.app/hust/gs/pygz/zbjs1/bygl) |
|
|
99
|
+
|
|
100
|
+
#### [教学管理](https://gs.hust.edu.cn/pygz/zbjs13/jxyj.htm)
|
|
101
|
+
|
|
102
|
+
| [教学研究](https://gs.hust.edu.cn/pygz/zbjs13/jxyj.htm) | [课程教材](https://gs.hust.edu.cn/pygz/zbjs13/kcjc.htm) | [教学安排](https://gs.hust.edu.cn/pygz/zbjs13/jxap.htm) | [课表查询](https://gs.hust.edu.cn/pygz/zbjs13/kbcx.htm) |
|
|
103
|
+
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
104
|
+
| [pygz/zbjs13/jxyj](https://rsshub.app/hust/gs/pygz/zbjs13/jxyj) | [pygz/zbjs13/kcjc](https://rsshub.app/hust/gs/pygz/zbjs13/kcjc) | [pygz/zbjs13/jxap](https://rsshub.app/hust/gs/pygz/zbjs13/jxap) | [pygz/zbjs13/kbcx](https://rsshub.app/hust/gs/pygz/zbjs13/kbcx) |
|
|
105
|
+
|
|
106
|
+
#### [培养过程](https://gs.hust.edu.cn/pygz/pygc.htm)
|
|
107
|
+
|
|
108
|
+
| [培养方案](https://gs.hust.edu.cn/pygz/pygc/pyfa.htm) | [硕博连读](https://gs.hust.edu.cn/pygz/pygc/sbld.htm) |
|
|
109
|
+
| ----------------------------------------------------------- | ----------------------------------------------------------- |
|
|
110
|
+
| [pygz/pygc/pyfa](https://rsshub.app/hust/gs/pygz/pygc/pyfa) | [pygz/pygc/sbld](https://rsshub.app/hust/gs/pygz/pygc/sbld) |
|
|
111
|
+
|
|
112
|
+
#### [国际交流](https://gs.hust.edu.cn/pygz/zbjs11/gjgpxm.htm)
|
|
113
|
+
|
|
114
|
+
| [国家公派项目](https://gs.hust.edu.cn/pygz/zbjs11/gjgpxm.htm) | [国际学术会议](https://gs.hust.edu.cn/pygz/zbjs11/gjxshy.htm) | [校际合作项目](https://gs.hust.edu.cn/pygz/zbjs11/xjhzxm.htm) | [国际交流与合作办事流程](https://gs.hust.edu.cn/pygz/zbjs11/gjjlyhzbslc.htm) |
|
|
115
|
+
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
116
|
+
| [pygz/zbjs11/gjgpxm](https://rsshub.app/hust/gs/pygz/zbjs11/gjgpxm) | [pygz/zbjs11/gjxshy](https://rsshub.app/hust/gs/pygz/zbjs11/gjxshy) | [pygz/zbjs11/xjhzxm](https://rsshub.app/hust/gs/pygz/zbjs11/xjhzxm) | [pygz/zbjs11/gjjlyhzbslc](https://rsshub.app/hust/gs/pygz/zbjs11/gjjlyhzbslc) |
|
|
117
|
+
|
|
118
|
+
#### [专业学位](https://gs.hust.edu.cn/pygz/zbjs111/xwsqdml.htm)
|
|
119
|
+
|
|
120
|
+
| [学位授权点目录](https://gs.hust.edu.cn/pygz/zbjs111/xwsqdml.htm) | [专业学位建设](https://gs.hust.edu.cn/pygz/zbjs111/zyxwjs.htm) | [特色培养](https://gs.hust.edu.cn/pygz/zbjs111/tspy.htm) |
|
|
121
|
+
| ----------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
122
|
+
| [pygz/zbjs111/xwsqdml](https://rsshub.app/hust/gs/pygz/zbjs111/xwsqdml) | [pygz/zbjs111/zyxwjs](https://rsshub.app/hust/gs/pygz/zbjs111/zyxwjs) | [pygz/zbjs111/tspy](https://rsshub.app/hust/gs/pygz/zbjs111/tspy) |
|
|
123
|
+
|
|
124
|
+
#### [学位工作](https://gs.hust.edu.cn/xwgz/xwdjs.htm)
|
|
125
|
+
|
|
126
|
+
| [学位点建设](https://gs.hust.edu.cn/xwgz/xwdjs.htm) | [学位授予](https://gs.hust.edu.cn/xwgz/xwsy.htm) | [导师队伍](https://gs.hust.edu.cn/xwgz/dsdw.htm) |
|
|
127
|
+
| --------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
|
128
|
+
| [xwgz/xwdjs](https://rsshub.app/hust/gs/xwgz/xwdjs) | [xwgz/xwsy](https://rsshub.app/hust/gs/xwgz/xwsy) | [xwgz/dsdw](https://rsshub.app/hust/gs/xwgz/dsdw) |
|
|
129
|
+
`,
|
|
130
|
+
categories: ['university'],
|
|
131
|
+
|
|
132
|
+
features: {
|
|
133
|
+
requireConfig: false,
|
|
134
|
+
requirePuppeteer: false,
|
|
135
|
+
antiCrawler: false,
|
|
136
|
+
supportRadar: true,
|
|
137
|
+
supportBT: false,
|
|
138
|
+
supportPodcast: false,
|
|
139
|
+
supportScihub: false,
|
|
140
|
+
},
|
|
141
|
+
radar: [
|
|
142
|
+
{
|
|
143
|
+
source: ['gs.hust.edu.cn/:category'],
|
|
144
|
+
target: (params) => {
|
|
145
|
+
const category = params.category;
|
|
146
|
+
|
|
147
|
+
return `/hust/gs${category ? `/${category}` : ''}`;
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: '新闻动态',
|
|
152
|
+
source: ['gs.hust.edu.cn/xwdt.htm'],
|
|
153
|
+
target: '/gs/xwdt',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: '研究生服务专区',
|
|
157
|
+
source: ['gs.hust.edu.cn/yjsfwzq.htm'],
|
|
158
|
+
target: '/gs/yjsfwzq',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
title: '综合管理',
|
|
162
|
+
source: ['gs.hust.edu.cn/gzzd/zhgl.htm'],
|
|
163
|
+
target: '/gs/gzzd/zhgl',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
title: '通知公告 - 课程及考试安排',
|
|
167
|
+
source: ['gs.hust.edu.cn/tzgg/kcjksap.htm'],
|
|
168
|
+
target: '/gs/tzgg/kcjksap',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: '通知公告 - 国际交流',
|
|
172
|
+
source: ['gs.hust.edu.cn/tzgg/gjjl.htm'],
|
|
173
|
+
target: '/gs/tzgg/gjjl',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
title: '通知公告 - 学位工作',
|
|
177
|
+
source: ['gs.hust.edu.cn/tzgg/xwgz.htm'],
|
|
178
|
+
target: '/gs/tzgg/xwgz',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
title: '通知公告 - 同济医学院',
|
|
182
|
+
source: ['gs.hust.edu.cn/tzgg/tjyxy.htm'],
|
|
183
|
+
target: '/gs/tzgg/tjyxy',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
title: '通知公告 - 其他',
|
|
187
|
+
source: ['gs.hust.edu.cn/tzgg/qt.htm'],
|
|
188
|
+
target: '/gs/tzgg/qt',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
title: '学籍管理 - 学籍异动',
|
|
192
|
+
source: ['gs.hust.edu.cn/pygz/zbjs1/xjyd.htm'],
|
|
193
|
+
target: '/gs/pygz/zbjs1/xjyd',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
title: '学籍管理 - 毕业管理',
|
|
197
|
+
source: ['gs.hust.edu.cn/pygz/zbjs1/bygl.htm'],
|
|
198
|
+
target: '/gs/pygz/zbjs1/bygl',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
title: '教学管理 - 教学研究',
|
|
202
|
+
source: ['gs.hust.edu.cn/pygz/zbjs13/jxyj.htm'],
|
|
203
|
+
target: '/gs/pygz/zbjs13/jxyj',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
title: '教学管理 - 课程教材',
|
|
207
|
+
source: ['gs.hust.edu.cn/pygz/zbjs13/kcjc.htm'],
|
|
208
|
+
target: '/gs/pygz/zbjs13/kcjc',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
title: '教学管理 - 教学安排',
|
|
212
|
+
source: ['gs.hust.edu.cn/pygz/zbjs13/jxap.htm'],
|
|
213
|
+
target: '/gs/pygz/zbjs13/jxap',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
title: '教学管理 - 课表查询',
|
|
217
|
+
source: ['gs.hust.edu.cn/pygz/zbjs13/kbcx.htm'],
|
|
218
|
+
target: '/gs/pygz/zbjs13/kbcx',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
title: '培养过程 - 培养方案',
|
|
222
|
+
source: ['gs.hust.edu.cn/pygz/pygc/pyfa.htm'],
|
|
223
|
+
target: '/gs/pygz/pygc/pyfa',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
title: '培养过程 - 硕博连读',
|
|
227
|
+
source: ['gs.hust.edu.cn/pygz/pygc/sbld.htm'],
|
|
228
|
+
target: '/gs/pygz/pygc/sbld',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
title: '国际交流 - 国家公派项目',
|
|
232
|
+
source: ['gs.hust.edu.cn/pygz/zbjs11/gjgpxm.htm'],
|
|
233
|
+
target: '/gs/pygz/zbjs11/gjgpxm',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
title: '国际交流 - 国际学术会议',
|
|
237
|
+
source: ['gs.hust.edu.cn/pygz/zbjs11/gjxshy.htm'],
|
|
238
|
+
target: '/gs/pygz/zbjs11/gjxshy',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
title: '国际交流 - 校际合作项目',
|
|
242
|
+
source: ['gs.hust.edu.cn/pygz/zbjs11/xjhzxm.htm'],
|
|
243
|
+
target: '/gs/pygz/zbjs11/xjhzxm',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
title: '国际交流 - 国际交流与合作办事流程',
|
|
247
|
+
source: ['gs.hust.edu.cn/pygz/zbjs11/gjjlyhzbslc.htm'],
|
|
248
|
+
target: '/gs/pygz/zbjs11/gjjlyhzbslc',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
title: '专业学位 - 学位授权点目录',
|
|
252
|
+
source: ['gs.hust.edu.cn/pygz/zbjs111/xwsqdml.htm'],
|
|
253
|
+
target: '/gs/pygz/zbjs111/xwsqdml',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
title: '专业学位 - 专业学位建设',
|
|
257
|
+
source: ['gs.hust.edu.cn/pygz/zbjs111/zyxwjs.htm'],
|
|
258
|
+
target: '/gs/pygz/zbjs111/zyxwjs',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
title: '专业学位 - 特色培养',
|
|
262
|
+
source: ['gs.hust.edu.cn/pygz/zbjs111/tspy.htm'],
|
|
263
|
+
target: '/gs/pygz/zbjs111/tspy',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
title: '学位工作 - 学位点建设',
|
|
267
|
+
source: ['gs.hust.edu.cn/xwgz/xwdjs.htm'],
|
|
268
|
+
target: '/gs/xwgz/xwdjs',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
title: '学位工作 - 学位授予',
|
|
272
|
+
source: ['gs.hust.edu.cn/xwgz/xwsy.htm'],
|
|
273
|
+
target: '/gs/xwgz/xwsy',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
title: '学位工作 - 导师队伍',
|
|
277
|
+
source: ['gs.hust.edu.cn/xwgz/dsdw.htm'],
|
|
278
|
+
target: '/gs/xwgz/dsdw',
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Route, ViewType } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { load } from 'cheerio';
|
|
4
|
+
|
|
5
|
+
export const route: Route = {
|
|
6
|
+
path: '/',
|
|
7
|
+
categories: ['blog'],
|
|
8
|
+
view: ViewType.Notifications,
|
|
9
|
+
example: '/imhcg',
|
|
10
|
+
parameters: {},
|
|
11
|
+
radar: [
|
|
12
|
+
{
|
|
13
|
+
source: ['infos.imhcg.cn'],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
name: 'Engineering blogs',
|
|
17
|
+
maintainers: ['ZiHao256'],
|
|
18
|
+
handler,
|
|
19
|
+
url: 'https://infos.imhcg.cn/',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
async function handler() {
|
|
23
|
+
const response = await ofetch('https://infos.imhcg.cn/');
|
|
24
|
+
const $ = load(response);
|
|
25
|
+
const items = $('li')
|
|
26
|
+
.toArray()
|
|
27
|
+
.map((item) => {
|
|
28
|
+
const title = $(item).find('a.title').text();
|
|
29
|
+
const link = $(item).find('a.title').attr('href');
|
|
30
|
+
const author = $(item).find('p.author').text();
|
|
31
|
+
const time = $(item).find('p.time').text();
|
|
32
|
+
const description = $(item).find('p.text').text();
|
|
33
|
+
return {
|
|
34
|
+
title,
|
|
35
|
+
link,
|
|
36
|
+
author,
|
|
37
|
+
time,
|
|
38
|
+
description,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
title: `Engineering Blogs`,
|
|
44
|
+
link: 'https://infos.imhcg.cn/',
|
|
45
|
+
item: items,
|
|
46
|
+
};
|
|
47
|
+
}
|