rsshub 1.0.0-master.ebff6c5 → 1.0.0-master.ec03e07
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/app.tsx +2 -0
- package/lib/config.ts +28 -6
- package/lib/errors/index.tsx +10 -3
- package/lib/index.ts +1 -1
- package/lib/middleware/anti-hotlink.test.ts +6 -6
- package/lib/middleware/logger.ts +5 -1
- package/lib/middleware/parameter.test.ts +22 -5
- package/lib/middleware/parameter.ts +47 -17
- package/lib/middleware/template.tsx +14 -10
- package/lib/middleware/trace.ts +25 -0
- package/lib/registry.test.ts +8 -0
- package/lib/registry.ts +8 -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/69shu/article.ts +4 -4
- package/lib/routes/aljazeera/index.ts +2 -2
- package/lib/routes/apnews/rss.ts +2 -1
- package/lib/routes/apnews/sitemap.ts +98 -0
- package/lib/routes/apnews/topics.ts +2 -1
- package/lib/routes/apnews/utils.ts +7 -5
- package/lib/routes/apple/apps.ts +30 -8
- package/lib/routes/asmr-200/index.ts +66 -0
- package/lib/routes/asmr-200/namespace.ts +6 -0
- package/lib/routes/asmr-200/templates/work.art +7 -0
- package/lib/routes/asmr-200/type.ts +96 -0
- package/lib/routes/autocentre/index.ts +29 -0
- package/lib/routes/autocentre/namespace.ts +7 -0
- package/lib/routes/bbc/index.ts +3 -1
- 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 -2
- package/lib/routes/bilibili/ranking.ts +2 -1
- package/lib/routes/bilibili/video.ts +2 -1
- 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/bluearchive/news.ts +2 -2
- package/lib/routes/bt0/mv.ts +21 -24
- package/lib/routes/bt0/tlist.ts +19 -26
- package/lib/routes/bt0/util.ts +6 -3
- package/lib/routes/buaa/jiaowu.ts +124 -0
- package/lib/routes/buaa/lib/space/newbook.ts +171 -0
- package/lib/routes/buaa/lib/space/templates/newbook.art +44 -0
- package/lib/routes/buaa/news/index.ts +15 -13
- package/lib/routes/buaa/sme.ts +5 -3
- 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 +48 -0
- package/lib/routes/chlinlearn/namespcae.ts +6 -0
- package/lib/routes/cnbc/rss.ts +1 -1
- package/lib/routes/copymanga/comic.ts +3 -1
- package/lib/routes/deadbydaylight/index.ts +69 -0
- package/lib/routes/deadbydaylight/namespace.ts +12 -0
- 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/dockerhub/build.ts +3 -2
- package/lib/routes/dongqiudi/result.ts +1 -1
- package/lib/routes/douban/other/group.ts +2 -1
- package/lib/routes/duckdb/namespace.ts +6 -0
- package/lib/routes/duckdb/news.ts +65 -0
- 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/epicgames/index.ts +14 -4
- package/lib/routes/fashionnetwork/index.ts +192 -0
- package/lib/routes/fashionnetwork/namespace.ts +8 -0
- package/lib/routes/fashionnetwork/templates/description.art +17 -0
- package/lib/routes/fediverse/timeline.ts +44 -19
- package/lib/routes/flashcat/blog.ts +61 -0
- package/lib/routes/flashcat/namespace.ts +6 -0
- package/lib/routes/foresightnews/util.ts +1 -1
- package/lib/routes/fortunechina/index.ts +24 -14
- 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/gdut/oa-news.ts +12 -17
- package/lib/routes/getitfree/util.ts +1 -1
- package/lib/routes/gisreportsonline/index.ts +60 -0
- package/lib/routes/gisreportsonline/namespace.ts +6 -0
- package/lib/routes/github/activity.ts +56 -0
- package/lib/routes/github/issue.ts +3 -2
- package/lib/routes/github/search.ts +20 -18
- package/lib/routes/github/star.ts +4 -3
- package/lib/routes/github/trending.ts +27 -5
- package/lib/routes/google/citations.ts +2 -2
- package/lib/routes/google/research.ts +45 -0
- package/lib/routes/google/scholar.ts +2 -2
- package/lib/routes/gov/chongqing/sydwgkzp.ts +4 -4
- package/lib/routes/gov/lswz/index.ts +289 -0
- package/lib/routes/gov/stats/index.ts +8 -8
- 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/hitcon/zeroday.ts +1 -1
- 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/huxiu/util.ts +2 -2
- 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/instagram/private-api/index.ts +20 -3
- package/lib/routes/investor/index.ts +213 -0
- package/lib/routes/investor/namespace.ts +8 -0
- package/lib/routes/iplaysoft/index.ts +68 -0
- package/lib/routes/iplaysoft/namespace.ts +6 -0
- package/lib/routes/iwara/subscriptions.ts +1 -1
- package/lib/routes/j-test/namespace.ts +6 -0
- package/lib/routes/j-test/news.ts +64 -0
- package/lib/routes/japanpost/namespace.ts +7 -1
- package/lib/routes/japanpost/router.ts +40 -0
- package/lib/routes/japanpost/track.ts +1 -23
- package/lib/routes/javbus/index.ts +2 -1
- package/lib/routes/javdb/actors.ts +6 -2
- package/lib/routes/jjwxc/book.ts +4 -3
- 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/kyodonews/index.ts +1 -1
- 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/lofter/user.ts +2 -1
- package/lib/routes/luolei/index.ts +1 -1
- package/lib/routes/maccms/index.ts +72 -0
- package/lib/routes/maccms/namespace.ts +9 -0
- package/lib/routes/maccms/type.ts +102 -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/metacritic/index.ts +10 -0
- package/lib/routes/metrics.ts +12 -0
- package/lib/routes/microsoft/mcr.ts +1 -1
- package/lib/routes/mihoyo/bbs/img-ranking.ts +4 -4
- package/lib/routes/mihoyo/bbs/static-data.ts +7 -0
- package/lib/routes/minecraft/version.ts +1 -1
- package/lib/routes/mirrormedia/category.ts +101 -0
- package/lib/routes/mirrormedia/index.ts +43 -0
- package/lib/routes/mirrormedia/namespace.ts +6 -0
- package/lib/routes/mirrormedia/utils.ts +19 -0
- package/lib/routes/misskey/user-timeline.ts +42 -0
- package/lib/routes/misskey/utils.ts +41 -1
- package/lib/routes/nasa/apod.ts +4 -3
- package/lib/routes/nasa/namespace.ts +1 -1
- package/lib/routes/nationalgeographic/latest-stories.ts +1 -1
- package/lib/routes/nationalgeographic/templates/stories.art +1 -1
- package/lib/routes/neea/index.ts +47 -19
- package/lib/routes/neea/jlpt.ts +12 -15
- package/lib/routes/neea/namespace.ts +2 -2
- package/lib/routes/newyorker/news.ts +24 -17
- package/lib/routes/nextjs/blog.ts +63 -0
- package/lib/routes/nextjs/namespace.ts +6 -0
- package/lib/routes/nga/forum.ts +3 -2
- package/lib/routes/notion/release.ts +81 -0
- package/lib/routes/nyaa/main.ts +2 -3
- package/lib/routes/nyaa/namespace.ts +10 -0
- package/lib/routes/oschina/news.ts +2 -0
- package/lib/routes/people/index.ts +4 -2
- package/lib/routes/picnob/namespace.ts +1 -4
- package/lib/routes/picnob/user.ts +3 -2
- package/lib/routes/picuki/namespace.ts +1 -4
- package/lib/routes/picuki/profile.ts +11 -7
- package/lib/routes/pixiv/ranking.ts +2 -1
- package/lib/routes/pixiv/search.ts +22 -2
- package/lib/routes/pixiv/user.ts +2 -1
- package/lib/routes/pixiv/utils.ts +3 -3
- package/lib/routes/ps/monthly-games.ts +3 -2
- 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/qidian/chapter.ts +4 -3
- 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/raycast/changelog.ts +54 -0
- package/lib/routes/raycast/namespace.ts +7 -0
- package/lib/routes/react/blog.ts +57 -0
- package/lib/routes/react/namespace.ts +6 -0
- package/lib/routes/readwise/list.ts +152 -0
- package/lib/routes/readwise/namespace.ts +6 -0
- package/lib/routes/rebase/geekdaily.ts +35 -0
- package/lib/routes/rebase/namespace.ts +6 -0
- package/lib/routes/reuters/common.ts +2 -1
- package/lib/routes/rss3/index.ts +157 -0
- package/lib/routes/rss3/interfaces/metadata.ts +67 -0
- package/lib/routes/rss3/namespace.ts +7 -0
- package/lib/routes/rsshub/routes.ts +20 -13
- package/lib/routes/samd/news.ts +1 -1
- package/lib/routes/sara/index.ts +1 -1
- package/lib/routes/sciencedirect/cf-email.ts +0 -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/sjtu/jwc.ts +4 -1
- package/lib/routes/sjtu/yzb/zkxx.ts +36 -16
- package/lib/routes/smzdm/keyword.ts +3 -2
- package/lib/routes/smzdm/product.ts +86 -0
- package/lib/routes/smzdm/ranking.ts +180 -46
- package/lib/routes/spotify/artist.ts +3 -2
- package/lib/routes/spotify/playlist.ts +3 -2
- 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 +4 -3
- 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/techcrunch/news.ts +20 -29
- package/lib/routes/techcrunch/templates/description.art +7 -0
- package/lib/routes/telecompaper/news.ts +1 -1
- package/lib/routes/telegram/channel.ts +38 -4
- package/lib/routes/test/index.ts +6 -36
- 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/thoughtworks/index.ts +71 -0
- package/lib/routes/thoughtworks/namespace.ts +6 -0
- package/lib/routes/towardsdatascience/latest.ts +67 -0
- package/lib/routes/towardsdatascience/namespace.ts +6 -0
- package/lib/routes/tsdm39/bd.ts +101 -0
- package/lib/routes/tsdm39/namespace.ts +7 -0
- package/lib/routes/tvb/news.ts +1 -0
- package/lib/routes/twitter/api/index.ts +3 -1
- package/lib/routes/twitter/api/mobile-api/login.ts +155 -131
- package/lib/routes/twitter/api/web-api/api.ts +19 -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 +98 -52
- package/lib/routes/twitter/home-latest.ts +60 -0
- package/lib/routes/twitter/home.ts +2 -2
- package/lib/routes/twitter/keyword.ts +3 -2
- package/lib/routes/twitter/likes.ts +1 -1
- package/lib/routes/twitter/list.ts +1 -1
- package/lib/routes/twitter/media.ts +4 -3
- package/lib/routes/twitter/namespace.ts +2 -2
- package/lib/routes/twitter/user.ts +5 -4
- package/lib/routes/twitter/utils.ts +4 -1
- package/lib/routes/uber/blog.ts +1 -1
- package/lib/routes/udn/breaking-news.ts +9 -0
- package/lib/routes/ustc/scms.ts +97 -0
- package/lib/routes/utgd/category.ts +18 -59
- package/lib/routes/utgd/timeline.ts +9 -45
- package/lib/routes/utgd/topic.ts +9 -51
- package/lib/routes/utgd/utils.ts +41 -0
- package/lib/routes/v2ex/tab.ts +3 -2
- package/lib/routes/v2ex/topics.ts +18 -3
- package/lib/routes/v2ex/xna.ts +55 -0
- package/lib/routes/watasuke/blog.ts +1 -1
- package/lib/routes/wchscu/namespace.ts +6 -0
- package/lib/routes/wchscu/recruit.ts +73 -0
- package/lib/routes/weibo/keyword.ts +3 -2
- package/lib/routes/weibo/namespace.ts +1 -1
- package/lib/routes/weibo/search/hot.ts +12 -7
- package/lib/routes/weibo/user.ts +2 -1
- package/lib/routes/weibo/utils.ts +20 -0
- package/lib/routes/wfu/news.ts +1 -1
- package/lib/routes/wordpress/util.ts +1 -1
- package/lib/routes/xiaohongshu/notes.ts +10 -2
- package/lib/routes/xiaohongshu/user.ts +23 -2
- package/lib/routes/xiaoyuzhou/podcast.ts +2 -1
- 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/xinhuanet/app.ts +109 -0
- package/lib/routes/xinhuanet/namespace.ts +8 -0
- package/lib/routes/xsijishe/forum.ts +5 -0
- package/lib/routes/xsijishe/rank.ts +23 -3
- package/lib/routes/yahoo/news/index.ts +149 -0
- package/lib/routes/yahoo/news/listid.ts +67 -0
- package/lib/routes/yahoo/news/{tw/provider-helper.ts → provider-helper.ts} +9 -4
- package/lib/routes/yahoo/news/{tw/provider.ts → provider.ts} +21 -6
- package/lib/routes/yahoo/news/{tw/utils.ts → utils.ts} +24 -15
- 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/youtube/user.ts +2 -1
- package/lib/routes/yystv/docs.ts +28 -19
- package/lib/routes/zcool/discover.ts +2 -1
- package/lib/routes/zhihu/activities.ts +2 -1
- package/lib/routes/zhihu/answers.ts +5 -1
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +2 -0
- package/lib/routes/zhihu/hot.ts +56 -7
- package/lib/routes/zhihu/namespace.ts +3 -0
- package/lib/routes/zhihu/utils.ts +16 -6
- package/lib/routes/zhuwang/index.ts +1 -1
- package/lib/routes/zsxq/types.ts +9 -0
- package/lib/routes/zsxq/utils.ts +4 -3
- package/lib/routes.test.ts +11 -5
- package/lib/setup.test.ts +1 -1
- package/lib/types.ts +20 -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/utils/ofetch.ts +14 -0
- package/lib/utils/otel/index.ts +2 -0
- package/lib/utils/otel/metric.ts +66 -0
- package/lib/utils/otel/trace.ts +28 -0
- package/lib/utils/request-rewriter/fetch.ts +8 -1
- package/lib/views/atom.tsx +2 -2
- package/lib/views/error.tsx +3 -3
- package/lib/views/index.tsx +4 -3
- package/lib/views/json.ts +1 -1
- package/lib/views/layout.tsx +1 -1
- package/lib/views/rss.tsx +2 -2
- package/package.json +60 -48
- package/lib/routes/moduzy/index.ts +0 -80
- package/lib/routes/moduzy/namespace.ts +0 -17
- package/lib/routes/moduzy/type.ts +0 -95
- package/lib/routes/sse/lawandrules.ts +0 -68
- package/lib/routes/yahoo/news/tw/index.ts +0 -80
- package/lib/routes/yahoo/news/us/index.ts +0 -55
- package/lib/routes/zhihu/hotlist.ts +0 -72
- package/lib/routes-deprecated/bjnews/news.js +0 -44
- package/lib/routes-deprecated/iplay/home.js +0 -26
- package/lib/routes-deprecated/iplay/utils.js +0 -57
- /package/lib/routes/{moduzy → maccms}/templates/vod.art +0 -0
package/lib/routes/szse/rule.ts
CHANGED
|
@@ -1,77 +1,350 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
+
|
|
2
3
|
import cache from '@/utils/cache';
|
|
3
4
|
import got from '@/utils/got';
|
|
4
5
|
import { load } from 'cheerio';
|
|
5
6
|
import { parseDate } from '@/utils/parse-date';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
supportBT: false,
|
|
17
|
-
supportPodcast: false,
|
|
18
|
-
supportScihub: false,
|
|
19
|
-
},
|
|
20
|
-
radar: [
|
|
21
|
-
{
|
|
22
|
-
source: ['szse.cn/lawrules/rule/new', 'szse.cn/'],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
name: '最新规则',
|
|
26
|
-
maintainers: ['nczitzk'],
|
|
27
|
-
handler,
|
|
28
|
-
url: 'szse.cn/lawrules/rule/new',
|
|
29
|
-
};
|
|
8
|
+
export const handler = async (ctx) => {
|
|
9
|
+
const { channel = 'allrules/bussiness' } = ctx.req.param();
|
|
10
|
+
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30;
|
|
11
|
+
|
|
12
|
+
const rootUrl = 'https://www.szse.cn';
|
|
13
|
+
const apiUrl = new URL('api/search/content', rootUrl).href;
|
|
14
|
+
const currentUrl = new URL(`www/lawrules/rule/${channel}/`, rootUrl).href;
|
|
15
|
+
|
|
16
|
+
const { data: currentResponse } = await got(currentUrl);
|
|
30
17
|
|
|
31
|
-
|
|
32
|
-
const rootUrl = 'http://www.szse.cn';
|
|
33
|
-
const currentUrl = `${rootUrl}/api/search/content`;
|
|
18
|
+
const $ = load(currentResponse);
|
|
34
19
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
const channelEl = $('ul.side-menu-con li.active').last();
|
|
21
|
+
const channelCode = channelEl.prop('chnlcode');
|
|
22
|
+
|
|
23
|
+
const { data: response } = await got.post(apiUrl, {
|
|
38
24
|
form: {
|
|
39
25
|
keyword: '',
|
|
40
26
|
time: 0,
|
|
41
27
|
range: 'title',
|
|
42
|
-
'channelCode[]':
|
|
28
|
+
'channelCode[]': channelCode,
|
|
43
29
|
currentPage: 1,
|
|
44
|
-
pageSize:
|
|
30
|
+
pageSize: limit,
|
|
45
31
|
scope: 0,
|
|
46
32
|
},
|
|
47
33
|
});
|
|
48
34
|
|
|
49
|
-
let items = response.data.
|
|
35
|
+
let items = response.data.slice(0, limit).map((item) => ({
|
|
50
36
|
title: item.doctitle,
|
|
37
|
+
pubDate: parseDate(item.docpubtime, 'X'),
|
|
51
38
|
link: item.docpuburl,
|
|
52
|
-
|
|
39
|
+
category: item.navigation,
|
|
53
40
|
}));
|
|
54
41
|
|
|
55
42
|
items = await Promise.all(
|
|
56
43
|
items.map((item) =>
|
|
57
44
|
cache.tryGet(item.link, async () => {
|
|
58
|
-
const detailResponse = await got(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
45
|
+
const { data: detailResponse } = await got(item.link);
|
|
46
|
+
|
|
47
|
+
const $$ = load(detailResponse);
|
|
62
48
|
|
|
63
|
-
const
|
|
49
|
+
const title = $$('h2.title').text();
|
|
50
|
+
const description = $$('div#desContent').html();
|
|
64
51
|
|
|
65
|
-
item.
|
|
52
|
+
item.title = title;
|
|
53
|
+
item.description = description;
|
|
54
|
+
item.pubDate = item.pubDate ?? parseDate($$('div.time span').text());
|
|
55
|
+
item.author = $$('meta[name="author"]').prop('content');
|
|
56
|
+
item.content = {
|
|
57
|
+
html: description,
|
|
58
|
+
text: $$('div#desContent').text(),
|
|
59
|
+
};
|
|
60
|
+
item.language = $$('html').prop('lang');
|
|
66
61
|
|
|
67
62
|
return item;
|
|
68
63
|
})
|
|
69
64
|
)
|
|
70
65
|
);
|
|
71
66
|
|
|
67
|
+
const image = $('a.navbar-brand img').prop('src');
|
|
68
|
+
|
|
72
69
|
return {
|
|
73
|
-
title:
|
|
74
|
-
|
|
70
|
+
title: `深圳证券交易所 - ${channelEl.text()}`,
|
|
71
|
+
description: $('meta[name="description"]').prop('content'),
|
|
72
|
+
link: currentUrl,
|
|
75
73
|
item: items,
|
|
74
|
+
allowEmpty: true,
|
|
75
|
+
image,
|
|
76
|
+
author: $('meta[name="author"]').prop('content'),
|
|
77
|
+
language: $('html').prop('lang'),
|
|
76
78
|
};
|
|
77
|
-
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const route: Route = {
|
|
82
|
+
path: '/rule/:channel{.+}?',
|
|
83
|
+
name: '本所业务规则',
|
|
84
|
+
url: 'www.szse.cn',
|
|
85
|
+
maintainers: ['nczitzk'],
|
|
86
|
+
handler,
|
|
87
|
+
example: '/szse/rule/allrules/bussiness',
|
|
88
|
+
parameters: { channel: '频道,默认为 `allrules/bussiness`,即全部业务规则,可在对应频道页 URL 中找到' },
|
|
89
|
+
description: `:::tip
|
|
90
|
+
若订阅 [综合类](https://www.szse.cn/www/lawrules/rule/all/index.html),网址为 \`https://www.szse.cn/www/lawrules/rule/all/index.html\`。截取 \`https://www.szse.cn/www/lawrules/rule/\` 到末尾 \`/index.html\` 的部分 \`all\` 作为参数填入,此时路由为 [\`/szse/rule/all\`](https://rsshub.app/szse/rule/all)。
|
|
91
|
+
:::
|
|
92
|
+
|
|
93
|
+
| 频道 | ID |
|
|
94
|
+
| --------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
95
|
+
| [综合类](https://www.szse.cn/www/lawrules/rule/all/index.html) | [all](https://rsshub.app/szes/rule/all) |
|
|
96
|
+
| [基础设施REITs类](https://www.szse.cn/www/lawrules/rule/reits/index.html) | [reits](https://rsshub.app/szes/rule/reits) |
|
|
97
|
+
| [衍生品类](https://www.szse.cn/www/lawrules/rule/derivative/index.html) | [derivative](https://rsshub.app/szes/rule/derivative) |
|
|
98
|
+
| [会员管理类](https://www.szse.cn/www/lawrules/rule/memberty/index.html) | [memberty](https://rsshub.app/szes/rule/memberty) |
|
|
99
|
+
| [纪律处分与内部救济类](https://www.szse.cn/www/lawrules/rule/pr/index.html) | [pr](https://rsshub.app/szes/rule/pr) |
|
|
100
|
+
|
|
101
|
+
#### 股票类
|
|
102
|
+
|
|
103
|
+
| 频道 | ID |
|
|
104
|
+
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
105
|
+
| [发行上市审核](https://www.szse.cn/www/lawrules/rule/stock/audit/index.html) | [stock/audit](https://rsshub.app/szes/rule/stock/audit) |
|
|
106
|
+
| [发行承销](https://www.szse.cn/www/lawrules/rule/stock/issue/index.html) | [stock/issue](https://rsshub.app/szes/rule/stock/issue) |
|
|
107
|
+
| [通用](https://www.szse.cn/www/lawrules/rule/stock/supervision/currency/index.html) | [stock/supervision/currency](https://rsshub.app/szes/rule/stock/supervision/currency) |
|
|
108
|
+
| [主板专用](https://www.szse.cn/www/lawrules/rule/stock/supervision/mb/index.html) | [stock/supervision/mb](https://rsshub.app/szes/rule/stock/supervision/mb) |
|
|
109
|
+
| [创业板专用](https://www.szse.cn/www/lawrules/rule/stock/supervision/chinext/index.html) | [stock/supervision/chinext](https://rsshub.app/szes/rule/stock/supervision/chinext) |
|
|
110
|
+
| [交易](https://www.szse.cn/www/lawrules/rule/stock/trade/index.html) | [stock/trade](https://rsshub.app/szes/rule/stock/trade) |
|
|
111
|
+
|
|
112
|
+
#### 固收类
|
|
113
|
+
|
|
114
|
+
| 频道 | ID |
|
|
115
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
|
116
|
+
| [发行上市(挂牌)](https://www.szse.cn/www/lawrules/rule/bond/bonds/list/index.html) | [bond/bonds/list](https://rsshub.app/szes/rule/bond/bonds/list) |
|
|
117
|
+
| [持续监管](https://www.szse.cn/www/lawrules/rule/bond/bonds/supervision/index.html) | [bond/bonds/supervision](https://rsshub.app/szes/rule/bond/bonds/supervision) |
|
|
118
|
+
| [交易](https://www.szse.cn/www/lawrules/rule/bond/bonds/trade/index.html) | [bond/bonds/trade](https://rsshub.app/szes/rule/bond/bonds/trade) |
|
|
119
|
+
| [资产支持证券](https://www.szse.cn/www/lawrules/rule/bond/abs/index.html) | [bond/abs](https://rsshub.app/szes/rule/bond/abs) |
|
|
120
|
+
|
|
121
|
+
#### 基金类
|
|
122
|
+
|
|
123
|
+
| 频道 | ID |
|
|
124
|
+
| ------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
125
|
+
| [上市](https://www.szse.cn/www/lawrules/rule/fund/list/index.html) | [fund/list](https://rsshub.app/szes/rule/fund/list) |
|
|
126
|
+
| [交易](https://www.szse.cn/www/lawrules/rule/fund/trade/index.html) | [fund/trade](https://rsshub.app/szes/rule/fund/trade) |
|
|
127
|
+
|
|
128
|
+
#### 交易类
|
|
129
|
+
|
|
130
|
+
| 频道 | ID |
|
|
131
|
+
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
132
|
+
| [通用](https://www.szse.cn/www/lawrules/rule/trade/current/index.html) | [trade/current](https://rsshub.app/szes/rule/trade/current) |
|
|
133
|
+
| [融资融券](https://www.szse.cn/www/lawrules/rule/trade/business/margin/index.html) | [trade/business/margin](https://rsshub.app/szes/rule/trade/business/margin) |
|
|
134
|
+
| [转融通](https://www.szse.cn/www/lawrules/rule/trade/business/refinancing/index.html) | [trade/business/refinancing](https://rsshub.app/szes/rule/trade/business/refinancing) |
|
|
135
|
+
| [股票质押式回购](https://www.szse.cn/www/lawrules/rule/trade/business/pledge/index.html) | [trade/business/pledge](https://rsshub.app/szes/rule/trade/business/pledge) |
|
|
136
|
+
| [质押式报价回购](https://www.szse.cn/www/lawrules/rule/trade/business/price/index.html) | [trade/business/price](https://rsshub.app/szes/rule/trade/business/price) |
|
|
137
|
+
| [约定购回](https://www.szse.cn/www/lawrules/rule/trade/business/promise/index.html) | [trade/business/promise](https://rsshub.app/szes/rule/trade/business/promise) |
|
|
138
|
+
| [协议转让](https://www.szse.cn/www/lawrules/rule/trade/business/transfer/index.html) | [trade/business/transfer](https://rsshub.app/szes/rule/trade/business/transfer) |
|
|
139
|
+
| [其他](https://www.szse.cn/www/lawrules/rule/trade/business/oth/index.html) | [trade/business/oth](https://rsshub.app/szes/rule/trade/business/oth) |
|
|
140
|
+
|
|
141
|
+
#### 跨境创新类
|
|
142
|
+
|
|
143
|
+
| 频道 | ID |
|
|
144
|
+
| ----------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
145
|
+
| [深港通](https://www.szse.cn/www/lawrules/rule/inno/szhk/index.html) | [inno/szhk](https://rsshub.app/szes/rule/inno/szhk) |
|
|
146
|
+
| [试点创新企业](https://www.szse.cn/www/lawrules/rule/inno/pilot/index.html) | [inno/pilot](https://rsshub.app/szes/rule/inno/pilot) |
|
|
147
|
+
| [H股全流通](https://www.szse.cn/www/lawrules/rule/inno/hc/index.html) | [inno/hc](https://rsshub.app/szes/rule/inno/hc) |
|
|
148
|
+
| [互联互通存托凭证](https://www.szse.cn/www/lawrules/rule/inno/gdr/index.html) | [inno/gdr](https://rsshub.app/szes/rule/inno/gdr) |
|
|
149
|
+
|
|
150
|
+
#### 全部规则
|
|
151
|
+
|
|
152
|
+
| 频道 | ID |
|
|
153
|
+
| ----------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
154
|
+
| [全部业务规则](https://www.szse.cn/www/lawrules/rule/allrules/bussiness/index.html) | [allrules/bussiness](https://rsshub.app/szes/rule/allrules/bussiness) |
|
|
155
|
+
| [规则汇编下载](https://www.szse.cn/www/lawrules/rule/allrules/rulejoin/index.html) | [allrules/rulejoin](https://rsshub.app/szes/rule/allrules/rulejoin) |
|
|
156
|
+
|
|
157
|
+
#### 已废止规则
|
|
158
|
+
|
|
159
|
+
| 频道 | ID |
|
|
160
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
|
|
161
|
+
| [规则废止公告](https://www.szse.cn/www/lawrules/rule/repeal/announcement/index.html) | [repeal/announcement](https://rsshub.app/szes/rule/repeal/announcement) |
|
|
162
|
+
| [已废止规则文本](https://www.szse.cn/www/lawrules/rule/repeal/rules/index.html) | [repeal/rules](https://rsshub.app/szes/rule/repeal/rules) |
|
|
163
|
+
`,
|
|
164
|
+
categories: ['finance'],
|
|
165
|
+
|
|
166
|
+
features: {
|
|
167
|
+
requireConfig: false,
|
|
168
|
+
requirePuppeteer: false,
|
|
169
|
+
antiCrawler: false,
|
|
170
|
+
supportRadar: true,
|
|
171
|
+
supportBT: false,
|
|
172
|
+
supportPodcast: false,
|
|
173
|
+
supportScihub: false,
|
|
174
|
+
},
|
|
175
|
+
radar: [
|
|
176
|
+
{
|
|
177
|
+
source: ['www.szse.cn/www/lawrules/rule/:category'],
|
|
178
|
+
target: (params) => {
|
|
179
|
+
const category = params.category;
|
|
180
|
+
|
|
181
|
+
return `/szse/rule${category ? `/${category}` : ''}`;
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: '综合类',
|
|
186
|
+
source: ['www.szse.cn/www/lawrules/rule/all/index.html'],
|
|
187
|
+
target: '/rule/all',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
title: '基础设施REITs类',
|
|
191
|
+
source: ['www.szse.cn/www/lawrules/rule/reits/index.html'],
|
|
192
|
+
target: '/rule/reits',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
title: '衍生品类',
|
|
196
|
+
source: ['www.szse.cn/www/lawrules/rule/derivative/index.html'],
|
|
197
|
+
target: '/rule/derivative',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
title: '会员管理类',
|
|
201
|
+
source: ['www.szse.cn/www/lawrules/rule/memberty/index.html'],
|
|
202
|
+
target: '/rule/memberty',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: '纪律处分与内部救济类',
|
|
206
|
+
source: ['www.szse.cn/www/lawrules/rule/pr/index.html'],
|
|
207
|
+
target: '/rule/pr',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: '股票类 - 发行上市审核',
|
|
211
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/audit/index.html'],
|
|
212
|
+
target: '/rule/stock/audit',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
title: '股票类 - 发行承销',
|
|
216
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/issue/index.html'],
|
|
217
|
+
target: '/rule/stock/issue',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
title: '股票类 - 通用',
|
|
221
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/supervision/currency/index.html'],
|
|
222
|
+
target: '/rule/stock/supervision/currency',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
title: '股票类 - 主板专用',
|
|
226
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/supervision/mb/index.html'],
|
|
227
|
+
target: '/rule/stock/supervision/mb',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
title: '股票类 - 创业板专用',
|
|
231
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/supervision/chinext/index.html'],
|
|
232
|
+
target: '/rule/stock/supervision/chinext',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
title: '股票类 - 交易',
|
|
236
|
+
source: ['www.szse.cn/www/lawrules/rule/stock/trade/index.html'],
|
|
237
|
+
target: '/rule/stock/trade',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
title: '固收类 - 发行上市(挂牌)',
|
|
241
|
+
source: ['www.szse.cn/www/lawrules/rule/bond/bonds/list/index.html'],
|
|
242
|
+
target: '/rule/bond/bonds/list',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
title: '固收类 - 持续监管',
|
|
246
|
+
source: ['www.szse.cn/www/lawrules/rule/bond/bonds/supervision/index.html'],
|
|
247
|
+
target: '/rule/bond/bonds/supervision',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
title: '固收类 - 交易',
|
|
251
|
+
source: ['www.szse.cn/www/lawrules/rule/bond/bonds/trade/index.html'],
|
|
252
|
+
target: '/rule/bond/bonds/trade',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
title: '固收类 - 资产支持证券',
|
|
256
|
+
source: ['www.szse.cn/www/lawrules/rule/bond/abs/index.html'],
|
|
257
|
+
target: '/rule/bond/abs',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
title: '基金类 - 上市',
|
|
261
|
+
source: ['www.szse.cn/www/lawrules/rule/fund/list/index.html'],
|
|
262
|
+
target: '/rule/fund/list',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
title: '基金类 - 交易',
|
|
266
|
+
source: ['www.szse.cn/www/lawrules/rule/fund/trade/index.html'],
|
|
267
|
+
target: '/rule/fund/trade',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
title: '交易类 - 通用',
|
|
271
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/current/index.html'],
|
|
272
|
+
target: '/rule/trade/current',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
title: '交易类 - 融资融券',
|
|
276
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/margin/index.html'],
|
|
277
|
+
target: '/rule/trade/business/margin',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
title: '交易类 - 转融通',
|
|
281
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/refinancing/index.html'],
|
|
282
|
+
target: '/rule/trade/business/refinancing',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
title: '交易类 - 股票质押式回购',
|
|
286
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/pledge/index.html'],
|
|
287
|
+
target: '/rule/trade/business/pledge',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
title: '交易类 - 质押式报价回购',
|
|
291
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/price/index.html'],
|
|
292
|
+
target: '/rule/trade/business/price',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
title: '交易类 - 约定购回',
|
|
296
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/promise/index.html'],
|
|
297
|
+
target: '/rule/trade/business/promise',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
title: '交易类 - 协议转让',
|
|
301
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/transfer/index.html'],
|
|
302
|
+
target: '/rule/trade/business/transfer',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
title: '交易类 - 其他',
|
|
306
|
+
source: ['www.szse.cn/www/lawrules/rule/trade/business/oth/index.html'],
|
|
307
|
+
target: '/rule/trade/business/oth',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
title: '跨境创新类 - 深港通',
|
|
311
|
+
source: ['www.szse.cn/www/lawrules/rule/inno/szhk/index.html'],
|
|
312
|
+
target: '/rule/inno/szhk',
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
title: '跨境创新类 - 试点创新企业',
|
|
316
|
+
source: ['www.szse.cn/www/lawrules/rule/inno/pilot/index.html'],
|
|
317
|
+
target: '/rule/inno/pilot',
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
title: '跨境创新类 - H股全流通',
|
|
321
|
+
source: ['www.szse.cn/www/lawrules/rule/inno/hc/index.html'],
|
|
322
|
+
target: '/rule/inno/hc',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
title: '跨境创新类 - 互联互通存托凭证',
|
|
326
|
+
source: ['www.szse.cn/www/lawrules/rule/inno/gdr/index.html'],
|
|
327
|
+
target: '/rule/inno/gdr',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
title: '全部规则 - 全部业务规则',
|
|
331
|
+
source: ['www.szse.cn/www/lawrules/rule/allrules/bussiness/index.html'],
|
|
332
|
+
target: '/rule/allrules/bussiness',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
title: '全部规则 - 规则汇编下载',
|
|
336
|
+
source: ['www.szse.cn/www/lawrules/rule/allrules/rulejoin/index.html'],
|
|
337
|
+
target: '/rule/allrules/rulejoin',
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: '已废止规则 - 规则废止公告',
|
|
341
|
+
source: ['www.szse.cn/www/lawrules/rule/repeal/announcement/index.html'],
|
|
342
|
+
target: '/rule/repeal/announcement',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
title: '已废止规则 - 已废止规则文本',
|
|
346
|
+
source: ['www.szse.cn/www/lawrules/rule/repeal/rules/index.html'],
|
|
347
|
+
target: '/rule/repeal/rules',
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
};
|
package/lib/routes/t66y/index.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { parseDate } from '@/utils/parse-date';
|
|
|
6
6
|
import { baseUrl, parseContent } from './utils';
|
|
7
7
|
|
|
8
8
|
export const route: Route = {
|
|
9
|
-
path: '/:id/:type?',
|
|
9
|
+
path: '/:id/:type?/:search?',
|
|
10
10
|
categories: ['multimedia'],
|
|
11
11
|
example: '/t66y/20/2',
|
|
12
|
-
parameters: { id: '分区 id, 可在分区页 URL 中找到', type: '类型 id, 可在分区类型过滤后的 URL 中找到' },
|
|
12
|
+
parameters: { id: '分区 id, 可在分区页 URL 中找到', type: '类型 id, 可在分区类型过滤后的 URL 中找到', search: '主题类型筛选,可在分区主题类型筛选后的 URL 中找到,默认为 `today`' },
|
|
13
13
|
features: {
|
|
14
14
|
requireConfig: false,
|
|
15
15
|
requirePuppeteer: false,
|
|
@@ -33,14 +33,35 @@ export const route: Route = {
|
|
|
33
33
|
|
|
34
34
|
| 技术讨论区 | 新时代的我们 | 达盖尔的旗帜 | 成人文学交流 |
|
|
35
35
|
| ---------- | ------------ | ------------ | ------------ |
|
|
36
|
-
| 7 | 8 | 16 | 20
|
|
36
|
+
| 7 | 8 | 16 | 20 |
|
|
37
|
+
|
|
38
|
+
**主题过滤**
|
|
39
|
+
|
|
40
|
+
> 因为该类型无法搭配子类型使用,所以使用时 \`type\` 子类型需使用 \`-999\` 占位
|
|
41
|
+
|
|
42
|
+
| 今日主题 | 热门主题 | 精华主题 | 原创主题 | 今日新作 |
|
|
43
|
+
| ------- | ------- | ------- | ------- | ------ |
|
|
44
|
+
| today | hot | digest | 1 | 2 |`,
|
|
37
45
|
};
|
|
38
46
|
|
|
47
|
+
const SEARCH_NAMES = {
|
|
48
|
+
today: '今日主题',
|
|
49
|
+
hot: '热门主题',
|
|
50
|
+
digest: '精华主题',
|
|
51
|
+
1: '原创主题',
|
|
52
|
+
2: '今日新作',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const DEFAULT_SEARCH_TYPE = 'today';
|
|
56
|
+
|
|
39
57
|
async function handler(ctx) {
|
|
40
|
-
const
|
|
58
|
+
const id = ctx.req.param('id');
|
|
59
|
+
const type = (Number.parseInt(ctx.req.param('type')) || -999).toString();
|
|
60
|
+
const isValidType = type !== '-999';
|
|
61
|
+
const search = isValidType ? DEFAULT_SEARCH_TYPE : (ctx.req.param('search') ?? DEFAULT_SEARCH_TYPE);
|
|
41
62
|
|
|
42
|
-
const url = new URL(`thread0806.php?fid=${id}&search
|
|
43
|
-
|
|
63
|
+
const url = new URL(`thread0806.php?fid=${id}&search=${search}`, baseUrl);
|
|
64
|
+
isValidType && url.searchParams.set('type', type);
|
|
44
65
|
|
|
45
66
|
const { data: res } = await got(url);
|
|
46
67
|
const $ = cheerio.load(res);
|
|
@@ -80,8 +101,9 @@ async function handler(ctx) {
|
|
|
80
101
|
);
|
|
81
102
|
|
|
82
103
|
return {
|
|
83
|
-
title: (
|
|
104
|
+
title: (isValidType ? `[${$('.t .fn b').text()}] ` : '') + (search ? `[${SEARCH_NAMES[search]}] ` : '') + $('head title').text(),
|
|
84
105
|
link: url.href,
|
|
85
106
|
item: out,
|
|
107
|
+
allowEmpty: true,
|
|
86
108
|
};
|
|
87
109
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
-
import cache from '@/utils/cache';
|
|
3
|
-
import parser from '@/utils/rss-parser';
|
|
4
2
|
import got from '@/utils/got';
|
|
5
3
|
import { load } from 'cheerio';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import { art } from '@/utils/render';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { getCurrentPath } from '@/utils/helpers';
|
|
8
|
+
const __dirname = getCurrentPath(import.meta.url);
|
|
9
|
+
|
|
6
10
|
const host = 'https://techcrunch.com';
|
|
7
11
|
export const route: Route = {
|
|
8
12
|
path: '/news',
|
|
@@ -29,33 +33,20 @@ export const route: Route = {
|
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
async function handler() {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
description.find('.article__byline__meta').remove();
|
|
47
|
-
description.find('.mobile-header-nav').remove();
|
|
48
|
-
description.find('.desktop-nav').remove();
|
|
49
|
-
return {
|
|
50
|
-
title: item.title,
|
|
51
|
-
pubDate: item.pubDate,
|
|
52
|
-
link: item.link,
|
|
53
|
-
category: item.categories,
|
|
54
|
-
description: description.html(),
|
|
55
|
-
};
|
|
56
|
-
})
|
|
57
|
-
)
|
|
58
|
-
);
|
|
36
|
+
const { data } = await got(`${host}/wp-json/wp/v2/posts`);
|
|
37
|
+
const items = data.map((item) => {
|
|
38
|
+
const head = item.yoast_head_json;
|
|
39
|
+
const $ = load(item.content.rendered, null, false);
|
|
40
|
+
return {
|
|
41
|
+
title: item.title.rendered,
|
|
42
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
43
|
+
head,
|
|
44
|
+
rendered: $.html(),
|
|
45
|
+
}),
|
|
46
|
+
link: item.link,
|
|
47
|
+
pubDate: parseDate(item.date_gmt),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
59
50
|
|
|
60
51
|
return {
|
|
61
52
|
title: 'TechCrunch',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Route } from '@/types';
|
|
1
|
+
import { Route, ViewType } from '@/types';
|
|
2
2
|
import { getCurrentPath } from '@/utils/helpers';
|
|
3
3
|
import cache from '@/utils/cache';
|
|
4
4
|
import { config } from '@/config';
|
|
@@ -58,12 +58,13 @@ const mediaTagDict = {
|
|
|
58
58
|
export const route: Route = {
|
|
59
59
|
path: '/channel/:username/:routeParams?',
|
|
60
60
|
categories: ['social-media', 'popular'],
|
|
61
|
-
|
|
61
|
+
view: ViewType.SocialMedia,
|
|
62
|
+
example: '/telegram/channel/awesomeRSSHub',
|
|
62
63
|
parameters: {
|
|
63
64
|
username: 'channel username',
|
|
64
65
|
routeParams: `extra parameters, see the table below
|
|
65
66
|
| Key | Description | Accepts | Defaults to |
|
|
66
|
-
|
|
|
67
|
+
| :--------------------: | :-------------------------------------------------------------------: | :------------------------------------------------: | :----------: |
|
|
67
68
|
| showLinkPreview | Show the link preview from Telegram | 0/1/true/false | true |
|
|
68
69
|
| showViaBot | For messages sent via bot, show the bot | 0/1/true/false | true |
|
|
69
70
|
| showReplyTo | For reply messages, show the target of the reply | 0/1/true/false | true |
|
|
@@ -427,7 +428,40 @@ async function handler(ctx) {
|
|
|
427
428
|
const background = $node.css('background-image');
|
|
428
429
|
const backgroundUrl = background && background.match(/url\('(.*)'\)/);
|
|
429
430
|
const backgroundUrlSrc = backgroundUrl && backgroundUrl[1];
|
|
430
|
-
|
|
431
|
+
const attrs = [`src="${backgroundUrlSrc}"`];
|
|
432
|
+
/*
|
|
433
|
+
* If the width is not in px, it is either a percentage (Link Preview/Instant view)
|
|
434
|
+
* or absent (ditto).
|
|
435
|
+
* Only accept px to prevent images from being invisible or too small.
|
|
436
|
+
*/
|
|
437
|
+
let width = 0;
|
|
438
|
+
const widthStr = $node.css('width');
|
|
439
|
+
if (widthStr && widthStr.endsWith('px')) {
|
|
440
|
+
width = Number.parseFloat(widthStr);
|
|
441
|
+
}
|
|
442
|
+
/*
|
|
443
|
+
* Height is present when the message is an album but does not exist in other cases.
|
|
444
|
+
* Ditto, only accept px.
|
|
445
|
+
* !!!NOTE: images in albums may have smaller width and height.
|
|
446
|
+
*/
|
|
447
|
+
let height = 0;
|
|
448
|
+
const heightStr = $node.css('height');
|
|
449
|
+
if (heightStr && heightStr.endsWith('px')) {
|
|
450
|
+
height = Number.parseFloat(heightStr);
|
|
451
|
+
}
|
|
452
|
+
/*
|
|
453
|
+
* Only calculate height when needed.
|
|
454
|
+
* The aspect ratio is either a percentage (single image) or absent (Link Preview).
|
|
455
|
+
* Only accept percentage to prevent images from being invisible or distorted.
|
|
456
|
+
*/
|
|
457
|
+
const aspectRatioStr = $node.find('.tgme_widget_message_photo').css('padding-top');
|
|
458
|
+
if (height <= 0 && width > 0 && aspectRatioStr && aspectRatioStr.endsWith('%')) {
|
|
459
|
+
height = (Number.parseFloat(aspectRatioStr) / 100) * width;
|
|
460
|
+
}
|
|
461
|
+
// Only set width/height when >32 to avoid invisible images.
|
|
462
|
+
width > 32 && attrs.push(`width="${width}"`);
|
|
463
|
+
height > 32 && attrs.push(`height="${height.toFixed(2).replace('.00', '')}"`);
|
|
464
|
+
tag_media += backgroundUrlSrc ? `<img ${attrs.join(' ')}>` : '';
|
|
431
465
|
}
|
|
432
466
|
if (tag_media) {
|
|
433
467
|
tag_media_all += tag_media;
|