rsshub 1.0.0-master.ff3a9ce → 1.0.0-master.ff3ea5a
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/config.ts +38 -0
- package/lib/errors/index.tsx +3 -2
- package/lib/middleware/debug.ts +6 -4
- package/lib/middleware/header.ts +4 -2
- package/lib/registry.test.ts +24 -1
- package/lib/registry.ts +40 -11
- package/lib/router.js +1 -1
- package/lib/routes/121/namespace.ts +9 -0
- package/lib/routes/121/templates/description.art +17 -0
- package/lib/routes/121/weather-live.ts +104 -0
- package/lib/routes/141jav/index.ts +3 -0
- package/lib/routes/141ppv/index.ts +3 -0
- package/lib/routes/163/news/rank.ts +1 -1
- package/lib/routes/18comic/album.ts +59 -64
- package/lib/routes/18comic/index.ts +1 -0
- package/lib/routes/18comic/search.ts +53 -4
- package/lib/routes/18comic/utils.ts +70 -1
- package/lib/routes/2048/index.ts +1 -0
- package/lib/routes/30secondsofcode/utils.ts +0 -1
- package/lib/routes/6park/index.ts +1 -1
- package/lib/routes/7mmtv/index.ts +1 -0
- package/lib/routes/91porn/index.ts +1 -0
- package/lib/routes/95mm/tab.ts +1 -0
- package/lib/routes/agefans/detail.ts +1 -1
- package/lib/routes/aliyun/database-month.ts +1 -1
- package/lib/routes/anthropic/research.ts +112 -0
- package/lib/routes/apnews/topics.ts +2 -1
- package/lib/routes/apnews/utils.ts +1 -1
- package/lib/routes/apple/design.ts +54 -0
- package/lib/routes/apple/namespace.ts +1 -1
- package/lib/routes/aqara/post.ts +1 -1
- package/lib/routes/augmentcode/blog.ts +161 -0
- package/lib/routes/augmentcode/namespace.ts +9 -0
- package/lib/routes/augmentcode/templates/description.art +17 -0
- package/lib/routes/azul/namespace.ts +9 -0
- package/lib/routes/azul/packages.ts +105 -0
- package/lib/routes/banshujiang/index.ts +763 -0
- package/lib/routes/banshujiang/namespace.ts +9 -0
- package/lib/routes/banshujiang/templates/description.art +17 -0
- package/lib/routes/bfl/announcements.ts +1 -1
- package/lib/routes/bilibili/cache.ts +78 -0
- package/lib/routes/bilibili/danmaku.ts +1 -1
- package/lib/routes/bilibili/dynamic.ts +8 -2
- package/lib/routes/bilibili/video.ts +31 -73
- package/lib/routes/biquge/index.ts +1 -1
- package/lib/routes/bsky/keyword.ts +15 -10
- package/lib/routes/capitalmind/insights.ts +40 -0
- package/lib/routes/capitalmind/namespace.ts +8 -0
- package/lib/routes/capitalmind/podcasts.ts +41 -0
- package/lib/routes/capitalmind/utils.ts +122 -0
- package/lib/routes/cartoonmad/comic.ts +1 -1
- package/lib/routes/chikubi/index.ts +1 -0
- package/lib/routes/chikubi/tag.ts +1 -0
- package/lib/routes/chocolatey/namespace.ts +9 -0
- package/lib/routes/chocolatey/packages.ts +122 -0
- package/lib/routes/cmde/index.ts +1 -1
- package/lib/routes/cockroachlabs/blog.ts +113 -0
- package/lib/routes/cockroachlabs/namespace.ts +7 -0
- package/lib/routes/cool18/index.ts +4 -1
- package/lib/routes/coomer/index.ts +12 -6
- package/lib/routes/coomer/namespace.ts +1 -1
- package/lib/routes/copymanga/comic.ts +7 -9
- package/lib/routes/css-tricks/articles.ts +48 -0
- package/lib/routes/css-tricks/collections.ts +62 -0
- package/lib/routes/css-tricks/namespace.ts +8 -0
- package/lib/routes/css-tricks/popular.ts +39 -0
- package/lib/routes/css-tricks/utils.ts +103 -0
- package/lib/routes/cursor/changelog.ts +26 -17
- package/lib/routes/cursor/namespace.ts +1 -1
- package/lib/routes/cw/utils.ts +6 -13
- package/lib/routes/dealstreetasia/home.ts +1 -1
- package/lib/routes/dedao/index.ts +3 -3
- package/lib/routes/deepl/blog.ts +422 -0
- package/lib/routes/deepl/namespace.ts +9 -0
- package/lib/routes/deepl/templates/description.art +21 -0
- package/lib/routes/deeplearning/the-batch.ts +1 -1
- package/lib/routes/dev.to/guides.ts +100 -0
- package/lib/routes/dev.to/namespace.ts +8 -0
- package/lib/routes/dev.to/top.ts +105 -0
- package/lib/routes/dgut/jwb.ts +73 -0
- package/lib/routes/dgut/namespace.ts +9 -0
- package/lib/routes/digitalpolicyalert/activity-tracker.ts +135 -0
- package/lib/routes/digitalpolicyalert/namespace.ts +9 -0
- package/lib/routes/dnaindia/common.ts +26 -8
- package/lib/routes/douban/other/list.ts +3 -3
- package/lib/routes/e-hentai/index.ts +4 -1
- package/lib/routes/ehentai/tag.ts +1 -0
- package/lib/routes/englishhome/index.ts +55 -0
- package/lib/routes/englishhome/namespace.ts +6 -0
- package/lib/routes/epicgames/index.ts +2 -2
- package/lib/routes/espn/news.ts +1 -1
- package/lib/routes/expats/czech-news.ts +272 -0
- package/lib/routes/expats/namespace.ts +9 -0
- package/lib/routes/fanbox/index.ts +1 -0
- package/lib/routes/fanbox/utils.ts +1 -1
- package/lib/routes/fansly/tag.ts +1 -0
- package/lib/routes/fantia/search.ts +1 -1
- package/lib/routes/fantube/creator.ts +69 -0
- package/lib/routes/fantube/namespace.ts +7 -0
- package/lib/routes/fantube/templates/post.art +17 -0
- package/lib/routes/fantube/types.ts +100 -0
- package/lib/routes/fantube/utils.ts +268 -0
- package/lib/routes/follow/profile.ts +1 -1
- package/lib/routes/followin/news.ts +1 -1
- package/lib/routes/foresightnews/util.ts +1 -1
- package/lib/routes/freexcomic/book.ts +4 -1
- package/lib/routes/gamer/hot.ts +5 -5
- package/lib/routes/gaoyu/blog.ts +145 -0
- package/lib/routes/gaoyu/namespace.ts +9 -0
- package/lib/routes/gaoyu/templates/description.art +7 -0
- package/lib/routes/geocaching/blogs.ts +2 -2
- package/lib/routes/github/namespace.ts +1 -1
- package/lib/routes/github/private-feed.ts +229 -0
- package/lib/routes/github/star.ts +1 -1
- package/lib/routes/google/extension.ts +9 -10
- package/lib/routes/gov/beijing/bphc/index.ts +1 -1
- package/lib/routes/gov/ccdi/index.ts +1 -1
- package/lib/routes/gov/chongqing/sydwgkzp.ts +22 -6
- package/lib/routes/gov/customs/list.ts +1 -1
- package/lib/routes/gov/general/general.ts +1 -1
- package/lib/routes/gov/hangzhou/zwfw.ts +1 -1
- package/lib/routes/gov/pbc/goutongjiaoliu.ts +1 -1
- package/lib/routes/gov/shenzhen/szlh/index.ts +77 -0
- package/lib/routes/gov/shenzhen/szlh/namespace.ts +8 -0
- package/lib/routes/grist/utils.ts +5 -4
- package/lib/routes/hanime1/search.ts +4 -2
- package/lib/routes/hellogithub/report.ts +1 -1
- package/lib/routes/hit/hitgs.ts +240 -54
- package/lib/routes/hit/templates/description.art +7 -0
- package/lib/routes/hlju/namespace.ts +8 -0
- package/lib/routes/hlju/news.ts +141 -0
- package/lib/routes/hostmonit/cloudflareyes.ts +1 -1
- package/lib/routes/hotukdeals/index.ts +1 -1
- package/lib/routes/hyperdash/namespace.ts +7 -0
- package/lib/routes/hyperdash/templates/description.art +34 -0
- package/lib/routes/hyperdash/top-traders.ts +84 -0
- package/lib/routes/hyperdash/utils.ts +49 -0
- package/lib/routes/hypergryph/arknights/announce.ts +1 -1
- package/lib/routes/ielts/index.ts +1 -1
- package/lib/routes/infoq/topic.ts +16 -13
- package/lib/routes/instagram/web-api/index.ts +17 -13
- package/lib/routes/instagram/web-api/utils.ts +46 -63
- package/lib/routes/jamesclear/book-summaries.ts +40 -0
- package/lib/routes/jamesclear/great-speeches.ts +40 -0
- package/lib/routes/jamesclear/namespace.ts +8 -0
- package/lib/routes/jamesclear/quotes.ts +40 -0
- package/lib/routes/jamesclear/three-two-one.ts +41 -0
- package/lib/routes/jamesclear/utils.ts +22 -0
- package/lib/routes/japanpost/utils.ts +2 -2
- package/lib/routes/javbus/index.ts +3 -0
- package/lib/routes/javdb/tags.ts +1 -0
- package/lib/routes/javlibrary/star.ts +1 -0
- package/lib/routes/javtiful/actress.ts +3 -0
- package/lib/routes/javtiful/channel.ts +3 -0
- package/lib/routes/javtrailers/casts.ts +3 -0
- package/lib/routes/jetbrains/comments.ts +99 -0
- package/lib/routes/jetbrains/namespace.ts +8 -0
- package/lib/routes/jimmyspa/books.ts +1 -1
- package/lib/routes/jimmyspa/news.ts +1 -1
- package/lib/routes/jpxgmn/tab.ts +3 -0
- package/lib/routes/kakuyomu/works.ts +3 -0
- package/lib/routes/kaopu/news.ts +1 -1
- package/lib/routes/kemono/const.ts +1 -1
- package/lib/routes/kemono/index.ts +12 -11
- package/lib/routes/kemono/namespace.ts +1 -1
- package/lib/routes/kiro/blog.ts +131 -0
- package/lib/routes/kiro/changelog.ts +128 -0
- package/lib/routes/kiro/namespace.ts +9 -0
- package/lib/routes/konachan/post.ts +3 -0
- package/lib/routes/kovidgoyal/kitty/changelog.ts +83 -0
- package/lib/routes/kovidgoyal/namespace.ts +7 -0
- package/lib/routes/kunchengblog/essay.ts +1 -1
- package/lib/routes/landiannews/category.ts +1 -1
- package/lib/routes/landiannews/index.ts +1 -1
- package/lib/routes/landiannews/tag.ts +1 -1
- package/lib/routes/line/utils.ts +1 -1
- package/lib/routes/lineageos/changes.ts +79 -0
- package/lib/routes/lineageos/namespace.ts +9 -0
- package/lib/routes/linkedin/cn/renderer.ts +1 -1
- package/lib/routes/liquipedia/cs-matches.ts +42 -14
- package/lib/routes/literotica/new.ts +1 -0
- package/lib/routes/lofter/tag.ts +27 -3
- package/lib/routes/makerworld/contest.ts +51 -0
- package/lib/routes/makerworld/namespace.ts +7 -0
- package/lib/routes/makerworld/trending.ts +45 -0
- package/lib/routes/makerworld/user-upload.ts +54 -0
- package/lib/routes/makerworld/utils.ts +18 -0
- package/lib/routes/manhuagui/comic.ts +1 -1
- package/lib/routes/manus/blog.ts +77 -0
- package/lib/routes/manus/namespace.ts +7 -0
- package/lib/routes/mastodon/tag.ts +48 -0
- package/lib/routes/mathpix/blog.ts +155 -0
- package/lib/routes/mathpix/namespace.ts +9 -0
- package/lib/routes/mathpix/templates/description.art +21 -0
- package/lib/routes/mckinsey/cn/category-map.ts +9 -15
- package/lib/routes/mckinsey/cn/index.ts +77 -40
- package/lib/routes/melonbooks/search.ts +1 -0
- package/lib/routes/metacritic/index.ts +2 -2
- package/lib/routes/meteoblue/namespace.ts +8 -0
- package/lib/routes/meteoblue/weathernews.ts +75 -0
- package/lib/routes/meteor/index.ts +1 -1
- package/lib/routes/microsoft/addon.ts +7 -9
- package/lib/routes/mihoyo/zzz/news.ts +106 -0
- package/lib/routes/missav/new.ts +2 -1
- package/lib/routes/mit/hanlab.ts +61 -0
- package/lib/routes/mit/namespace.ts +6 -0
- package/lib/routes/mittrchina/index.ts +3 -3
- package/lib/routes/mixcloud/config.ts +129 -0
- package/lib/routes/mixcloud/index.ts +163 -107
- package/lib/routes/mixcloud/user-playlist.ts +31 -0
- package/lib/routes/mixi2/community.ts +72 -0
- package/lib/routes/mixi2/discovery.ts +52 -0
- package/lib/routes/mixi2/home.ts +51 -0
- package/lib/routes/mixi2/namespace.ts +8 -0
- package/lib/routes/mixi2/user.ts +77 -0
- package/lib/routes/mixi2/utils.ts +56 -0
- package/lib/routes/modelscope/learn.ts +94 -0
- package/lib/routes/moodysmismicrosite/report.ts +1 -1
- package/lib/routes/musify/index.ts +130 -0
- package/lib/routes/musify/namespace.ts +9 -0
- package/lib/routes/musikguru/namespace.ts +9 -0
- package/lib/routes/musikguru/news.ts +146 -0
- package/lib/routes/musikguru/templates/description.art +21 -0
- package/lib/routes/myfans/post.ts +1 -0
- package/lib/routes/nankai/cc-notice.ts +114 -0
- package/lib/routes/nankai/jwc.ts +131 -0
- package/lib/routes/nankai/namespace.ts +7 -0
- package/lib/routes/nankai/notice.ts +84 -0
- package/lib/routes/nankai/yzb.ts +97 -0
- package/lib/routes/neu/yz.ts +172 -0
- package/lib/routes/newslaundry/explainer.ts +30 -0
- package/lib/routes/newslaundry/namespace.ts +8 -0
- package/lib/routes/newslaundry/nl-cheatsheet.ts +30 -0
- package/lib/routes/newslaundry/nl-collaborations.ts +30 -0
- package/lib/routes/newslaundry/podcast.ts +61 -0
- package/lib/routes/newslaundry/reports.ts +30 -0
- package/lib/routes/newslaundry/shot.ts +30 -0
- package/lib/routes/newslaundry/subscriber-only.ts +30 -0
- package/lib/routes/newslaundry/templates/description.art +28 -0
- package/lib/routes/newslaundry/utils.ts +108 -0
- package/lib/routes/newswav/latest.ts +100 -0
- package/lib/routes/newswav/namespace.ts +7 -0
- package/lib/routes/nhentai/index.ts +1 -0
- package/lib/routes/nifd/research.ts +16 -0
- package/lib/routes/nio/namespace.ts +9 -0
- package/lib/routes/nio/nioradio.ts +75 -0
- package/lib/routes/njust/cs.ts +58 -0
- package/lib/routes/njust/utils.ts +1 -1
- package/lib/routes/ntdm/video.ts +1 -1
- package/lib/routes/nuaa/utils/pypasswaf.ts +1 -1
- package/lib/routes/oilchem/index.ts +1 -1
- package/lib/routes/oncc/money18.ts +1 -1
- package/lib/routes/openai/cookbook.ts +1 -1
- package/lib/routes/paulgraham/article.ts +2 -2
- package/lib/routes/picuki/profile.ts +4 -0
- package/lib/routes/pixiv/bookmarks.ts +1 -1
- package/lib/routes/pixiv/novel-api/series/sfw.ts +1 -1
- package/lib/routes/pixiv/novels.ts +2 -2
- package/lib/routes/pixiv/user.ts +1 -1
- package/lib/routes/playno1/av.ts +1 -0
- package/lib/routes/pornhub/model.ts +3 -7
- package/lib/routes/pornhub/pornstar.ts +2 -7
- package/lib/routes/pornhub/users.ts +2 -7
- package/lib/routes/pornhub/utils.ts +12 -1
- package/lib/routes/qingting/podcast.ts +2 -1
- package/lib/routes/qipamaijia/index.ts +1 -0
- package/lib/routes/questmobile/report.ts +1 -1
- package/lib/routes/railway/index.ts +73 -0
- package/lib/routes/railway/namespace.ts +8 -0
- package/lib/routes/reuters/common.ts +0 -3
- package/lib/routes/rockthejvm/articles.ts +167 -0
- package/lib/routes/rockthejvm/namespace.ts +9 -0
- package/lib/routes/rockthejvm/templates/description.art +7 -0
- package/lib/routes/samrdprc/namespace.ts +7 -0
- package/lib/routes/samrdprc/news.ts +79 -0
- package/lib/routes/sankei/namespace.ts +7 -0
- package/lib/routes/sankei/news.ts +68 -0
- package/lib/routes/sankei/topics.ts +71 -0
- package/lib/routes/sciencenet/user.ts +1 -1
- package/lib/routes/scoop/apps.ts +188 -0
- package/lib/routes/scoop/namespace.ts +9 -0
- package/lib/routes/scoop/templates/description.art +56 -0
- package/lib/routes/scpta/namespace.ts +8 -0
- package/lib/routes/scpta/news.ts +101 -0
- package/lib/routes/seekingalpha/index.ts +1 -1
- package/lib/routes/sehuatang/index.ts +29 -31
- package/lib/routes/setn/index.ts +11 -2
- package/lib/routes/seu/cyber/index.ts +78 -0
- package/lib/routes/sicau/jiaowu.ts +42 -34
- package/lib/routes/sis001/forum.ts +1 -0
- package/lib/routes/sjtu/seiee/icisee.ts +67 -0
- package/lib/routes/sketis/isabelle-dev/blog/index.ts +1 -1
- package/lib/routes/smartlink/index.ts +13 -3
- package/lib/routes/sohu/mp.ts +17 -6
- package/lib/routes/sotwe/namespace.ts +1 -0
- package/lib/routes/sotwe/user.ts +98 -0
- package/lib/routes/spankbang/new-videos.ts +1 -0
- package/lib/routes/spglobal/ratings.ts +1 -1
- package/lib/routes/stanford/blog.ts +77 -0
- package/lib/routes/stanford/namespace.ts +7 -0
- package/lib/routes/syosetu/index.ts +1 -1
- package/lib/routes/t66y/index.ts +1 -0
- package/lib/routes/taobao/mysql.ts +157 -0
- package/lib/routes/taobao/namespace.ts +2 -2
- package/lib/routes/techcrunch/category.ts +48 -0
- package/lib/routes/telegram/channel.ts +2 -2
- package/lib/routes/tesla/cx.ts +1 -1
- package/lib/routes/test/index.ts +1 -1
- package/lib/routes/themoviedb/episodes.ts +1 -1
- package/lib/routes/thewirehindi/category.ts +78 -0
- package/lib/routes/thewirehindi/index.ts +43 -0
- package/lib/routes/thewirehindi/namespace.ts +7 -0
- package/lib/routes/thewirehindi/templates/description.art +9 -0
- package/lib/routes/thewirehindi/utils.ts +33 -0
- package/lib/routes/threads/utils.ts +2 -2
- package/lib/routes/tidb/blog.ts +314 -0
- package/lib/routes/tidb/namespace.ts +9 -0
- package/lib/routes/tumblr/namespace.ts +17 -0
- package/lib/routes/tumblr/posts.ts +74 -0
- package/lib/routes/tumblr/utils.ts +110 -0
- package/lib/routes/tver/namespace.ts +7 -0
- package/lib/routes/tver/series.ts +98 -0
- package/lib/routes/twitter/api/web-api/login.ts +1 -3
- package/lib/routes/twitter/api/web-api/utils.ts +23 -1
- package/lib/routes/twitter/utils.ts +21 -21
- package/lib/routes/udn/breaking-news.ts +2 -2
- package/lib/routes/uestc/auto.ts +1 -1
- package/lib/routes/uestc/cqe.ts +1 -1
- package/lib/routes/uestc/scse.ts +1 -1
- package/lib/routes/uestc/sice.ts +1 -1
- package/lib/routes/uestc/sise.ts +1 -1
- package/lib/routes/upc/jwc.ts +32 -46
- package/lib/routes/uptimerobot/rss.ts +1 -1
- package/lib/routes/visionias/daily-news-summary.ts +65 -0
- package/lib/routes/visionias/monthly-magazine.ts +68 -0
- package/lib/routes/visionias/news-today.ts +3 -13
- package/lib/routes/visionias/utils.ts +5 -5
- package/lib/routes/visionias/weekly-focus.ts +2 -2
- package/lib/routes/wdfxw/bookfree.ts +528 -0
- package/lib/routes/wdfxw/namespace.ts +8 -0
- package/lib/routes/wdfxw/templates/description.art +13 -0
- package/lib/routes/whu/swrh.ts +1 -1
- package/lib/routes/windsurf/blog.ts +118 -0
- package/lib/routes/windsurf/changelog.ts +100 -0
- package/lib/routes/windsurf/namespace.ts +9 -0
- package/lib/routes/windsurf/templates/description.art +21 -0
- package/lib/routes/x6d/index.ts +1 -1
- package/lib/routes/xbookcn/blog.ts +1 -0
- package/lib/routes/xiaohongshu/util.ts +1 -3
- package/lib/routes/xiaoyuzhou/pickup.ts +1 -1
- package/lib/routes/ximalaya/album.ts +32 -70
- package/lib/routes/ximalaya/types.ts +48 -0
- package/lib/routes/ximalaya/utils.ts +9 -7
- package/lib/routes/xmanhua/index.ts +1 -0
- package/lib/routes/xueqiu/cookies.ts +1 -1
- package/lib/routes/xueqiu/user.ts +1 -1
- package/lib/routes/xwenming/index.ts +184 -0
- package/lib/routes/xwenming/namespace.ts +9 -0
- package/lib/routes/yahoo/news/utils.ts +1 -1
- package/lib/routes/yande/post.ts +3 -0
- package/lib/routes/ymgal/game.ts +1 -0
- package/lib/routes/youtube/api/google.ts +27 -0
- package/lib/routes/youtube/api/youtubei.ts +70 -20
- package/lib/routes/youtube/community.ts +3 -1
- package/lib/routes/youtube/utils.ts +16 -14
- package/lib/routes/zaobao/util.ts +8 -5
- package/lib/routes/zhihu/activities.ts +3 -0
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +5 -5
- package/lib/routes/zhizhuan100/namespace.ts +7 -0
- package/lib/routes/zhizhuan100/report.ts +79 -0
- package/lib/routes/zimuxia/portfolio.ts +1 -1
- package/lib/routes/zju/sis/index.ts +161 -0
- package/lib/server.ts +5 -0
- package/lib/types.ts +58 -54
- package/lib/utils/helpers.ts +1 -1
- package/lib/utils/logger.ts +1 -1
- package/lib/utils/proxy/index.ts +102 -18
- package/lib/utils/proxy/multi-proxy.ts +139 -0
- package/lib/utils/proxy/unify-proxy.ts +3 -1
- package/lib/utils/puppeteer-utils.test.ts +1 -1
- package/lib/utils/puppeteer.test.ts +14 -27
- package/lib/utils/puppeteer.ts +51 -37
- package/lib/utils/readable-social.test.ts +65 -0
- package/lib/utils/readable-social.ts +15 -1
- package/lib/utils/request-rewriter/fetch.ts +42 -4
- package/package.json +54 -56
- package/lib/routes/mixcloud/queries.ts +0 -2274
- package/lib/routes-deprecated/dev.to/top.js +0 -40
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { type Data, type DataItem, type Route, ViewType } from '@/types';
|
|
2
|
+
|
|
3
|
+
import { art } from '@/utils/render';
|
|
4
|
+
import cache from '@/utils/cache';
|
|
5
|
+
import ofetch from '@/utils/ofetch';
|
|
6
|
+
import { parseDate } from '@/utils/parse-date';
|
|
7
|
+
|
|
8
|
+
import { type CheerioAPI, type Cheerio, load } from 'cheerio';
|
|
9
|
+
import type { Element } from 'domhandler';
|
|
10
|
+
import { type Context } from 'hono';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
|
|
13
|
+
export const handler = async (ctx: Context): Promise<Data> => {
|
|
14
|
+
const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10);
|
|
15
|
+
|
|
16
|
+
const baseUrl: string = 'https://mathpix.com';
|
|
17
|
+
const targetUrl: string = new URL('blog', baseUrl).href;
|
|
18
|
+
|
|
19
|
+
const response = await ofetch(targetUrl);
|
|
20
|
+
const $: CheerioAPI = load(response);
|
|
21
|
+
const language = $('html').attr('lang') ?? 'en';
|
|
22
|
+
|
|
23
|
+
const categoryMap = {};
|
|
24
|
+
|
|
25
|
+
$('div.navbar-menu a.blog-category').each((_, el) => {
|
|
26
|
+
const $el: Cheerio<Element> = $(el);
|
|
27
|
+
|
|
28
|
+
const id: string = $el.attr('data-category');
|
|
29
|
+
const name: string = $el.text()?.trim();
|
|
30
|
+
|
|
31
|
+
if (id && name) {
|
|
32
|
+
categoryMap[id] = name;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
let items: DataItem[] = [];
|
|
37
|
+
|
|
38
|
+
items = $('li.articles__item')
|
|
39
|
+
.slice(0, limit)
|
|
40
|
+
.toArray()
|
|
41
|
+
.map((el): Element => {
|
|
42
|
+
const $el: Cheerio<Element> = $(el);
|
|
43
|
+
|
|
44
|
+
const title: string = $el.find('a.articles__title').text();
|
|
45
|
+
const image: string | undefined = $el.find('div.articles__image img').attr('srcset') ? new URL($el.find('div.articles__image img').attr('srcset') as string, baseUrl).href : undefined;
|
|
46
|
+
const description: string | undefined = art(path.join(__dirname, 'templates/description.art'), {
|
|
47
|
+
images: image
|
|
48
|
+
? [
|
|
49
|
+
{
|
|
50
|
+
src: image,
|
|
51
|
+
alt: title,
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
: undefined,
|
|
55
|
+
intro: $el.find('div.articles__text').text(),
|
|
56
|
+
});
|
|
57
|
+
const pubDateStr: string | undefined = $el.find('time.articles__date').attr('datetime');
|
|
58
|
+
const linkUrl: string | undefined = $el.find('a.articles__title').attr('href');
|
|
59
|
+
const categoryIds: string[] =
|
|
60
|
+
$el
|
|
61
|
+
.attr('data-category')
|
|
62
|
+
?.split(/,\s/)
|
|
63
|
+
.map((category) => category.trim()) ?? [];
|
|
64
|
+
const categories: string[] = categoryIds.map((id) => categoryMap[id]).filter(Boolean);
|
|
65
|
+
const upDatedStr: string | undefined = pubDateStr;
|
|
66
|
+
|
|
67
|
+
const processedItem: DataItem = {
|
|
68
|
+
title,
|
|
69
|
+
description,
|
|
70
|
+
pubDate: pubDateStr ? parseDate(pubDateStr) : undefined,
|
|
71
|
+
link: linkUrl ? new URL(linkUrl, baseUrl).href : undefined,
|
|
72
|
+
category: categories,
|
|
73
|
+
content: {
|
|
74
|
+
html: description,
|
|
75
|
+
text: description,
|
|
76
|
+
},
|
|
77
|
+
image,
|
|
78
|
+
banner: image,
|
|
79
|
+
updated: upDatedStr ? parseDate(upDatedStr) : undefined,
|
|
80
|
+
language,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return processedItem;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
items = await Promise.all(
|
|
87
|
+
items.map((item) => {
|
|
88
|
+
if (!item.link) {
|
|
89
|
+
return item;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return cache.tryGet(item.link, async (): Promise<DataItem> => {
|
|
93
|
+
const detailResponse = await ofetch(item.link);
|
|
94
|
+
const $$: CheerioAPI = load(detailResponse);
|
|
95
|
+
|
|
96
|
+
const title: string = $$('h1.article__title').text();
|
|
97
|
+
const description: string | undefined = $$('div#setText').html();
|
|
98
|
+
|
|
99
|
+
const processedItem: DataItem = {
|
|
100
|
+
title,
|
|
101
|
+
description,
|
|
102
|
+
content: {
|
|
103
|
+
html: description,
|
|
104
|
+
text: description,
|
|
105
|
+
},
|
|
106
|
+
language,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
...item,
|
|
111
|
+
...processedItem,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
title: $('title').text(),
|
|
119
|
+
description: $('meta[property="og:description"]').attr('content'),
|
|
120
|
+
link: targetUrl,
|
|
121
|
+
item: items,
|
|
122
|
+
allowEmpty: true,
|
|
123
|
+
image: $('meta[property="og:image"]').attr('content'),
|
|
124
|
+
language,
|
|
125
|
+
id: $('meta[property="og:url"]').attr('content'),
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const route: Route = {
|
|
130
|
+
path: '/blog',
|
|
131
|
+
name: 'Blog',
|
|
132
|
+
url: 'mathpix.com',
|
|
133
|
+
maintainers: ['nczitzk'],
|
|
134
|
+
handler,
|
|
135
|
+
example: '/mathpix/blog',
|
|
136
|
+
parameters: undefined,
|
|
137
|
+
description: undefined,
|
|
138
|
+
categories: ['blog'],
|
|
139
|
+
features: {
|
|
140
|
+
requireConfig: false,
|
|
141
|
+
requirePuppeteer: false,
|
|
142
|
+
antiCrawler: false,
|
|
143
|
+
supportRadar: true,
|
|
144
|
+
supportBT: false,
|
|
145
|
+
supportPodcast: false,
|
|
146
|
+
supportScihub: false,
|
|
147
|
+
},
|
|
148
|
+
radar: [
|
|
149
|
+
{
|
|
150
|
+
source: ['mathpix.com/blog'],
|
|
151
|
+
target: '/blog',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
view: ViewType.Articles,
|
|
155
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{ if images }}
|
|
2
|
+
{{ each images image }}
|
|
3
|
+
{{ if image?.src }}
|
|
4
|
+
<figure>
|
|
5
|
+
<img
|
|
6
|
+
{{ if image.alt }}
|
|
7
|
+
alt="{{ image.alt }}"
|
|
8
|
+
{{ /if }}
|
|
9
|
+
src="{{ image.src }}">
|
|
10
|
+
</figure>
|
|
11
|
+
{{ /if }}
|
|
12
|
+
{{ /each }}
|
|
13
|
+
{{ /if }}
|
|
14
|
+
|
|
15
|
+
{{ if intro }}
|
|
16
|
+
<blockquote>{{ intro }}</blockquote>
|
|
17
|
+
{{ /if }}
|
|
18
|
+
|
|
19
|
+
{{ if description }}
|
|
20
|
+
{{@ description }}
|
|
21
|
+
{{ /if }}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const categories = {
|
|
1
|
+
export const categories = {
|
|
2
2
|
// https://www.mckinsey.com.cn/wp-json/wp/v2/categories?parent=25&per_page=100
|
|
3
3
|
2: {
|
|
4
4
|
name: '汽车',
|
|
@@ -13,7 +13,7 @@ const categories = {
|
|
|
13
13
|
slug: 'consumers',
|
|
14
14
|
},
|
|
15
15
|
5: {
|
|
16
|
-
name: '
|
|
16
|
+
name: '医药与医疗',
|
|
17
17
|
slug: 'healthcare-pharmaceuticals',
|
|
18
18
|
},
|
|
19
19
|
7: {
|
|
@@ -24,17 +24,13 @@ const categories = {
|
|
|
24
24
|
name: '制造业',
|
|
25
25
|
slug: 'manufacturing',
|
|
26
26
|
},
|
|
27
|
-
9: {
|
|
28
|
-
name: '私募',
|
|
29
|
-
slug: 'private-equity',
|
|
30
|
-
},
|
|
31
27
|
10: {
|
|
32
28
|
name: '技术,媒体与通信',
|
|
33
29
|
slug: 'technology-media-and-telecom',
|
|
34
30
|
},
|
|
35
31
|
12: {
|
|
36
32
|
name: '城市化与可持续发展',
|
|
37
|
-
slug: 'urbanization-sustainability
|
|
33
|
+
slug: 'urbanization-sustainability',
|
|
38
34
|
},
|
|
39
35
|
13: {
|
|
40
36
|
name: '创新',
|
|
@@ -56,22 +52,20 @@ const categories = {
|
|
|
56
52
|
name: '洞见',
|
|
57
53
|
slug: 'insights',
|
|
58
54
|
},
|
|
59
|
-
37: {
|
|
60
|
-
name: '麦肯锡季刊',
|
|
61
|
-
slug: 'mckinsey-season-publication',
|
|
62
|
-
},
|
|
63
55
|
41: {
|
|
64
56
|
name: '资本项目和基础设施',
|
|
65
57
|
slug: 'capital-projects-infrastructure',
|
|
66
58
|
},
|
|
67
59
|
42: {
|
|
68
60
|
name: '旅游、运输和物流',
|
|
69
|
-
slug: '
|
|
61
|
+
slug: '交通运输与物流',
|
|
62
|
+
},
|
|
63
|
+
19139: {
|
|
64
|
+
name: '出海与国际化、转型',
|
|
65
|
+
slug: '出海与国际化、转型',
|
|
70
66
|
},
|
|
71
67
|
45: {
|
|
72
68
|
name: '全球基础材料',
|
|
73
|
-
slug: '
|
|
69
|
+
slug: '全球基础材料',
|
|
74
70
|
},
|
|
75
71
|
};
|
|
76
|
-
|
|
77
|
-
export { categories };
|
|
@@ -2,9 +2,10 @@ import { Route, ViewType } from '@/types';
|
|
|
2
2
|
import ofetch from '@/utils/ofetch';
|
|
3
3
|
import { parseDate } from '@/utils/parse-date';
|
|
4
4
|
import { categories } from './category-map';
|
|
5
|
+
import { load } from 'cheerio';
|
|
6
|
+
import cache from '@/utils/cache';
|
|
5
7
|
|
|
6
8
|
const baseUrl = 'https://www.mckinsey.com.cn';
|
|
7
|
-
const endpoint = `${baseUrl}/wp-json`;
|
|
8
9
|
|
|
9
10
|
export const route: Route = {
|
|
10
11
|
path: '/cn/:category?',
|
|
@@ -13,9 +14,9 @@ export const route: Route = {
|
|
|
13
14
|
example: '/mckinsey/cn',
|
|
14
15
|
parameters: {
|
|
15
16
|
category: {
|
|
16
|
-
description: '
|
|
17
|
-
options: Object.entries(categories).map(([
|
|
18
|
-
default: '
|
|
17
|
+
description: '分类,留空为 `最新洞见`',
|
|
18
|
+
options: Object.entries(categories).map(([, label]) => ({ value: label.slug, label: label.name })),
|
|
19
|
+
default: '最新洞见',
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
features: {
|
|
@@ -29,52 +30,88 @@ export const route: Route = {
|
|
|
29
30
|
name: '洞见',
|
|
30
31
|
maintainers: ['laampui'],
|
|
31
32
|
handler,
|
|
32
|
-
description: `| 分类
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
| 45 | 全球基础材料 |`,
|
|
33
|
+
description: `| 分类 | 分类名 |
|
|
34
|
+
| ------------------------------- | ------------------ |
|
|
35
|
+
| | 全部洞见 |
|
|
36
|
+
| autos | 汽车 |
|
|
37
|
+
| banking-insurance | 金融服务 |
|
|
38
|
+
| consumers | 消费者 |
|
|
39
|
+
| healthcare-pharmaceuticals | 医药与医疗 |
|
|
40
|
+
| business-technology | 数字化 |
|
|
41
|
+
| manufacturing | 制造业 |
|
|
42
|
+
| technology-media-and-telecom | 技术,媒体与通信 |
|
|
43
|
+
| urbanization-sustainability | 城市化与可持续发展 |
|
|
44
|
+
| innovation | 创新 |
|
|
45
|
+
| talent-leadership | 人才与领导力 |
|
|
46
|
+
| macroeconomy | 宏观经济 |
|
|
47
|
+
| mckinsey-global-institute | 麦肯锡全球研究院 |
|
|
48
|
+
| capital-projects-infrastructure | 资本项目和基础设施 |
|
|
49
|
+
| 交通运输与物流 | 旅游、运输和物流 |
|
|
50
|
+
| 出海与国际化、转型 | 出海与国际化、转型 |
|
|
51
|
+
| 全球基础材料 | 全球基础材料 |`,
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
async function handler(ctx) {
|
|
55
55
|
const { category = '25' } = ctx.req.param();
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
|
|
57
|
+
let categorySlug = '';
|
|
58
|
+
if (category === '25') {
|
|
59
|
+
/* empty */
|
|
60
|
+
} else if (categories[category]) {
|
|
61
|
+
// Category number for backwards compatibility
|
|
62
|
+
categorySlug = categories[category].slug;
|
|
63
|
+
} else {
|
|
64
|
+
// Category slug
|
|
65
|
+
const c = Object.values(categories).find((c) => c.slug === category);
|
|
66
|
+
categorySlug = c ? c.slug : '';
|
|
58
67
|
}
|
|
68
|
+
const link = `${baseUrl}/insights/${categorySlug ? `${categorySlug}/` : ''}`;
|
|
59
69
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
const headers = {
|
|
71
|
+
'accept-language': 'en-US,en;q=0.9',
|
|
72
|
+
'sec-fetch-dest': 'document',
|
|
73
|
+
'sec-fetch-mode': 'navigate',
|
|
74
|
+
'sec-fetch-site': 'none',
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const response = await ofetch(link, {
|
|
78
|
+
headers,
|
|
65
79
|
});
|
|
80
|
+
const $ = load(response);
|
|
81
|
+
|
|
82
|
+
const list = $('.fl-post-grid-post')
|
|
83
|
+
.toArray()
|
|
84
|
+
.map((item) => {
|
|
85
|
+
const $item = $(item);
|
|
86
|
+
const a = $item.find('h2 a');
|
|
87
|
+
return {
|
|
88
|
+
title: a.attr('title'),
|
|
89
|
+
description: $item.find('.fl-post-grid-content').html()?.trim(),
|
|
90
|
+
link: a.attr('href'),
|
|
91
|
+
pubDate: $item.find('[itemprop="datePublished"]').length ? parseDate($item.find('[itemprop="datePublished"]').attr('content')!) : undefined,
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const items = await Promise.all(
|
|
96
|
+
list.map((item) =>
|
|
97
|
+
cache.tryGet(item.link, async () => {
|
|
98
|
+
const response = await ofetch(item.link, {
|
|
99
|
+
headers,
|
|
100
|
+
});
|
|
101
|
+
const $ = load(response);
|
|
102
|
+
|
|
103
|
+
item.description = $('.ast-post-format-').html() || item.description;
|
|
104
|
+
item.guid = $('link[rel="shortlink"]').attr('href');
|
|
66
105
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
guid: item.guid.rendered,
|
|
72
|
-
pubDate: parseDate(item.date_gmt),
|
|
73
|
-
}));
|
|
106
|
+
return item;
|
|
107
|
+
})
|
|
108
|
+
)
|
|
109
|
+
);
|
|
74
110
|
|
|
75
111
|
return {
|
|
76
|
-
title:
|
|
77
|
-
link
|
|
112
|
+
title: $('head title').text(),
|
|
113
|
+
link,
|
|
114
|
+
image: $('meta[name="msapplication-TileImage"]').attr('content'),
|
|
78
115
|
item: items,
|
|
79
116
|
};
|
|
80
117
|
}
|
|
@@ -21,7 +21,7 @@ async function handler(ctx) {
|
|
|
21
21
|
|
|
22
22
|
const rootUrl = 'https://www.metacritic.com';
|
|
23
23
|
const rootApiUrl = 'https://backend.metacritic.com';
|
|
24
|
-
const apiUrl = new URL('
|
|
24
|
+
const apiUrl = new URL('finder/metacritic/web', rootApiUrl).href;
|
|
25
25
|
|
|
26
26
|
const currentUrlObject = new URL(`/browse/${type}/all/all/all-time/${sort}/${filter ? `?${filter}` : ''}`, rootUrl);
|
|
27
27
|
const currentUrlParams = currentUrlObject.searchParams;
|
|
@@ -112,7 +112,7 @@ async function handler(ctx) {
|
|
|
112
112
|
description: item.description,
|
|
113
113
|
score: item.criticScoreSummary?.score ?? undefined,
|
|
114
114
|
}),
|
|
115
|
-
category: item.genres
|
|
115
|
+
category: item.genres?.map((c) => c.name),
|
|
116
116
|
guid: `metacritic-${item.id}`,
|
|
117
117
|
pubDate: parseDate(item.releaseDate),
|
|
118
118
|
upvotes: item.criticScoreSummary?.positiveCount ? Number.parseInt(item.criticScoreSummary?.positiveCount, 10) : 0,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import { load } from 'cheerio';
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
|
|
6
|
+
export const route: Route = {
|
|
7
|
+
path: '/weathernews',
|
|
8
|
+
name: 'Weather News',
|
|
9
|
+
maintainers: ['tssujt'],
|
|
10
|
+
handler,
|
|
11
|
+
example: '/meteoblue/weathernews',
|
|
12
|
+
categories: ['blog'],
|
|
13
|
+
features: {
|
|
14
|
+
requireConfig: false,
|
|
15
|
+
requirePuppeteer: false,
|
|
16
|
+
antiCrawler: false,
|
|
17
|
+
supportBT: false,
|
|
18
|
+
supportPodcast: false,
|
|
19
|
+
supportScihub: false,
|
|
20
|
+
},
|
|
21
|
+
description: 'Weather news and articles from meteoblue',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
async function handler() {
|
|
25
|
+
const baseUrl = 'https://www.meteoblue.com';
|
|
26
|
+
const url = `${baseUrl}/en/blog/article/weathernews`;
|
|
27
|
+
|
|
28
|
+
const response = await ofetch(url);
|
|
29
|
+
const $ = load(response);
|
|
30
|
+
|
|
31
|
+
// Extract articles from the page using the actual HTML structure
|
|
32
|
+
const articles = $('article[itemprop="blogPost"]')
|
|
33
|
+
.toArray()
|
|
34
|
+
.map((element) => {
|
|
35
|
+
const $article = $(element);
|
|
36
|
+
|
|
37
|
+
// Get title and link from h3 > a
|
|
38
|
+
const $link = $article.find('h3[itemprop="headline"] a[itemprop="mainEntityOfPage"]');
|
|
39
|
+
const title = $link.text().trim();
|
|
40
|
+
const link = $link.attr('href');
|
|
41
|
+
|
|
42
|
+
if (!title || !link) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Get date from time element
|
|
47
|
+
const $time = $article.find('time[itemprop="datePublished"]');
|
|
48
|
+
const dateText = $time.attr('datetime') || '';
|
|
49
|
+
|
|
50
|
+
// Extract author from the time element text
|
|
51
|
+
const $authorMeta = $article.find('meta[itemprop="author"]');
|
|
52
|
+
const author = $authorMeta.attr('content')?.trim() || 'meteoblue';
|
|
53
|
+
|
|
54
|
+
// Get description from itemprop="description"
|
|
55
|
+
const $description = $article.find('div[itemprop="description"]');
|
|
56
|
+
const description = $description.text().trim() || title;
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
title,
|
|
60
|
+
link: link.startsWith('http') ? link : `${baseUrl}${link}`,
|
|
61
|
+
pubDate: dateText ? parseDate(dateText) : undefined,
|
|
62
|
+
author,
|
|
63
|
+
description,
|
|
64
|
+
};
|
|
65
|
+
})
|
|
66
|
+
.filter(Boolean);
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
title: 'meteoblue Weather News',
|
|
70
|
+
link: url,
|
|
71
|
+
description: 'Latest weather news and articles from meteoblue',
|
|
72
|
+
item: articles,
|
|
73
|
+
allowEmpty: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -58,7 +58,7 @@ async function handler(ctx) {
|
|
|
58
58
|
return {
|
|
59
59
|
title: `${board === 'all' ? '全部看板' : boardInfo.title} | Meteor 學生社群`,
|
|
60
60
|
description: board === 'all' ? null : boardInfo.feedDescription,
|
|
61
|
-
image: board === 'all' ? null :
|
|
61
|
+
image: board === 'all' ? null : boardInfo.imgUrl === 'not_set' ? null : boardInfo.imgUrl,
|
|
62
62
|
link: `${board === 'all' ? `${baseUrl}/board/all` : boardInfo.link}/new`,
|
|
63
63
|
item: items,
|
|
64
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
-
import
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
3
|
|
|
4
4
|
export const route: Route = {
|
|
5
5
|
path: '/edge/addon/:crxid',
|
|
@@ -27,21 +27,19 @@ export const route: Route = {
|
|
|
27
27
|
async function handler(ctx) {
|
|
28
28
|
const crxid = ctx.req.param('crxid');
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const pageUrl = `https://microsoftedge.microsoft.com/addons/detail/${crxid}`;
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
method: 'get',
|
|
34
|
-
url: `https://microsoftedge.microsoft.com/addons/getproductdetailsbycrxid/${crxid}?hl=en`,
|
|
32
|
+
const data = await ofetch(`https://microsoftedge.microsoft.com/addons/getproductdetailsbycrxid/${crxid}?hl=en`, {
|
|
35
33
|
headers: {
|
|
36
|
-
Referer:
|
|
34
|
+
Referer: pageUrl,
|
|
37
35
|
},
|
|
38
36
|
});
|
|
39
37
|
|
|
40
38
|
return {
|
|
41
39
|
title: `${data.name} - Microsoft Edge Addons`,
|
|
42
40
|
description: data.shortDescription,
|
|
43
|
-
image: `https:${data.
|
|
44
|
-
link:
|
|
41
|
+
image: `https:${data.logoUrl}`,
|
|
42
|
+
link: pageUrl,
|
|
45
43
|
item: [
|
|
46
44
|
{
|
|
47
45
|
title: 'v' + data.version,
|
|
@@ -49,7 +47,7 @@ async function handler(ctx) {
|
|
|
49
47
|
description: data.description,
|
|
50
48
|
pubDate: new Date(data.lastUpdateDate * 1000),
|
|
51
49
|
guid: `edge::${crxid}::${data.version}`,
|
|
52
|
-
link:
|
|
50
|
+
link: pageUrl,
|
|
53
51
|
},
|
|
54
52
|
],
|
|
55
53
|
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import got from '@/utils/got';
|
|
3
|
+
import { parseDate } from '@/utils/parse-date';
|
|
4
|
+
|
|
5
|
+
const categories = {
|
|
6
|
+
'zh-cn': {
|
|
7
|
+
'news-all': {
|
|
8
|
+
id: '273',
|
|
9
|
+
title: '最新',
|
|
10
|
+
},
|
|
11
|
+
news: {
|
|
12
|
+
id: '278',
|
|
13
|
+
title: '新闻',
|
|
14
|
+
},
|
|
15
|
+
notice: {
|
|
16
|
+
id: '279',
|
|
17
|
+
title: '公告',
|
|
18
|
+
},
|
|
19
|
+
activity: {
|
|
20
|
+
id: '280',
|
|
21
|
+
title: '活动',
|
|
22
|
+
},
|
|
23
|
+
title: '绝区零',
|
|
24
|
+
link: 'https://zzz.mihoyo.com/news',
|
|
25
|
+
apiRootUrl: 'https://api-takumi-static.mihoyo.com/content_v2_user/app/706fd13a87294881/getContentList',
|
|
26
|
+
},
|
|
27
|
+
'zh-tw': {
|
|
28
|
+
'news-all': {
|
|
29
|
+
id: '288',
|
|
30
|
+
title: '最新',
|
|
31
|
+
},
|
|
32
|
+
news: {
|
|
33
|
+
id: '295',
|
|
34
|
+
title: '新聞',
|
|
35
|
+
},
|
|
36
|
+
notice: {
|
|
37
|
+
id: '296',
|
|
38
|
+
title: '公告',
|
|
39
|
+
},
|
|
40
|
+
activity: {
|
|
41
|
+
id: '297',
|
|
42
|
+
title: '活動',
|
|
43
|
+
},
|
|
44
|
+
title: '絕區零',
|
|
45
|
+
link: 'https://zenless.hoyoverse.com/zh-tw/news',
|
|
46
|
+
apiRootUrl: 'https://api-os-takumi-static.hoyoverse.com/content_v2_user/app/3e9196a4b9274bd7/getContentList',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const route: Route = {
|
|
51
|
+
path: '/zzz/:location?/:category?',
|
|
52
|
+
categories: ['game'],
|
|
53
|
+
example: '/mihoyo/zzz',
|
|
54
|
+
parameters: { location: '区域,可选 `zh-cn`(国服,简中)或 `zh-tw`(国际服,繁中)', category: '分类,见下表,默认为最新' },
|
|
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: ['zzz.mihoyo.com/news'],
|
|
66
|
+
target: '/zzz',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
name: '绝区零',
|
|
70
|
+
maintainers: ['Yeye-0426'],
|
|
71
|
+
handler,
|
|
72
|
+
url: 'zzz.mihoyo.com/news',
|
|
73
|
+
description: `#### 新闻 {#mi-ha-you-jue-qu-ling-xin-wen}
|
|
74
|
+
|
|
75
|
+
| 最新 | 新闻 | 公告 | 活动 |
|
|
76
|
+
| -------- | ---- | ------ | -------- |
|
|
77
|
+
| news-all | news | notice | activity |`,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
async function handler(ctx) {
|
|
81
|
+
// location 地区 category 类型
|
|
82
|
+
const { location = 'zh-cn', category = 'news-all' } = ctx.req.param();
|
|
83
|
+
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50;
|
|
84
|
+
|
|
85
|
+
const params = {
|
|
86
|
+
'zh-cn': `iPageSize=${limit}&iPage=1&sLangKey=zh-cn&isPreview=0&iChanId=${categories[location][category].id}`,
|
|
87
|
+
'zh-tw': `iPageSize=${limit}&iPage=1&sLangKey=zh-tw&isPreview=0&iChanId=${categories[location][category].id}`,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const apiUrl = `${categories[location].apiRootUrl}?${params[location]}`;
|
|
91
|
+
const response = await got(apiUrl);
|
|
92
|
+
const list = response.data.data.list;
|
|
93
|
+
const items = list.map((item) => ({
|
|
94
|
+
title: item.sTitle,
|
|
95
|
+
description: item.sContent,
|
|
96
|
+
link: `${categories[location].link}/${item.iInfoId}`,
|
|
97
|
+
pubDate: parseDate(item.dtStartTime),
|
|
98
|
+
category: item.sCategoryName,
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
title: `${categories[location][category].title}-${categories[location].title}`,
|
|
103
|
+
link: `${categories[location].link}?category=${categories[location][category].id}`,
|
|
104
|
+
item: items,
|
|
105
|
+
};
|
|
106
|
+
}
|