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.
Potentially problematic release.
This version of rsshub might be problematic. Click here for more details.
- 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,114 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Route } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import got from '@/utils/got';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { load } from 'cheerio';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { parseDate } from '@/utils/parse-date';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import cache from '@/utils/cache';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import timezone from '@/utils/timezone';
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                path: '/cc/:type?',
         
     | 
| 
      
 10 
     | 
    
         
            +
                categories: ['university'],
         
     | 
| 
      
 11 
     | 
    
         
            +
                example: '/nankai/cc/13291',
         
     | 
| 
      
 12 
     | 
    
         
            +
                parameters: { type: '栏目编号(若为空则默认为"最新动态")' },
         
     | 
| 
      
 13 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 20 
     | 
    
         
            +
                },
         
     | 
| 
      
 21 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 22 
     | 
    
         
            +
                    {
         
     | 
| 
      
 23 
     | 
    
         
            +
                        source: ['cc.nankai.edu.cn', 'cc.nankai.edu.cn/:type/list.htm'],
         
     | 
| 
      
 24 
     | 
    
         
            +
                        target: '/cc/:type?',
         
     | 
| 
      
 25 
     | 
    
         
            +
                    },
         
     | 
| 
      
 26 
     | 
    
         
            +
                ],
         
     | 
| 
      
 27 
     | 
    
         
            +
                name: '计算机学院',
         
     | 
| 
      
 28 
     | 
    
         
            +
                maintainers: ['vicguo0724'],
         
     | 
| 
      
 29 
     | 
    
         
            +
                description: `| 最新动态 | 学院公告 | 学生工作通知 | 科研信息 | 本科生教学 | 党团园地 | 研究生招生 | 研究生教学 | 境外交流 |
         
     | 
| 
      
 30 
     | 
    
         
            +
            | -------- | -------- | ---------- | -------- | ---------- | -------- | ---------- | ---------- | -------- |
         
     | 
| 
      
 31 
     | 
    
         
            +
            | 13291    | 13292    | 13293      | 13294    | 13295      | 13296    | 13297      | 13298      | 13299    |`,
         
     | 
| 
      
 32 
     | 
    
         
            +
                url: 'cc.nankai.edu.cn',
         
     | 
| 
      
 33 
     | 
    
         
            +
                handler: async (ctx) => {
         
     | 
| 
      
 34 
     | 
    
         
            +
                    // 从 URL 参数中获取通知分类
         
     | 
| 
      
 35 
     | 
    
         
            +
                    const { type = '13291' } = ctx.req.param();
         
     | 
| 
      
 36 
     | 
    
         
            +
                    const baseUrl = 'https://cc.nankai.edu.cn';
         
     | 
| 
      
 37 
     | 
    
         
            +
                    const { data: response } = await got(`${baseUrl}/${type}/list.htm`);
         
     | 
| 
      
 38 
     | 
    
         
            +
                    const $ = load(response);
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                    // 获取分类名称
         
     | 
| 
      
 41 
     | 
    
         
            +
                    const categoryName = $('.accordion .selected a').text().trim() || '最新动态';
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                    // 解析新闻列表
         
     | 
| 
      
 44 
     | 
    
         
            +
                    const list = $('#wp_news_w49 table tr')
         
     | 
| 
      
 45 
     | 
    
         
            +
                        .slice(1) // 跳过表头
         
     | 
| 
      
 46 
     | 
    
         
            +
                        .toArray()
         
     | 
| 
      
 47 
     | 
    
         
            +
                        .map((tr) => {
         
     | 
| 
      
 48 
     | 
    
         
            +
                            const $tr = $(tr);
         
     | 
| 
      
 49 
     | 
    
         
            +
                            const cells = $tr.find('td');
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                            if (cells.length < 5) {
         
     | 
| 
      
 52 
     | 
    
         
            +
                                return null;
         
     | 
| 
      
 53 
     | 
    
         
            +
                            }
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                            const title = cells.eq(1).text().trim();
         
     | 
| 
      
 56 
     | 
    
         
            +
                            const publisher = cells.eq(2).text().trim();
         
     | 
| 
      
 57 
     | 
    
         
            +
                            const dateStr = cells.eq(3).text().trim();
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
                            // 从onclick属性中提取链接
         
     | 
| 
      
 60 
     | 
    
         
            +
                            const onclick = $tr.attr('onclick');
         
     | 
| 
      
 61 
     | 
    
         
            +
                            let link = '';
         
     | 
| 
      
 62 
     | 
    
         
            +
                            if (onclick) {
         
     | 
| 
      
 63 
     | 
    
         
            +
                                const match = onclick.match(/window\.location\.href='([^']+)';/);
         
     | 
| 
      
 64 
     | 
    
         
            +
                                if (match) {
         
     | 
| 
      
 65 
     | 
    
         
            +
                                    link = match[1];
         
     | 
| 
      
 66 
     | 
    
         
            +
                                    if (!link.startsWith('http')) {
         
     | 
| 
      
 67 
     | 
    
         
            +
                                        link = `${baseUrl}${link}`;
         
     | 
| 
      
 68 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 69 
     | 
    
         
            +
                                }
         
     | 
| 
      
 70 
     | 
    
         
            +
                            }
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
                            return {
         
     | 
| 
      
 73 
     | 
    
         
            +
                                title,
         
     | 
| 
      
 74 
     | 
    
         
            +
                                link,
         
     | 
| 
      
 75 
     | 
    
         
            +
                                pubDate: timezone(parseDate(dateStr), +8),
         
     | 
| 
      
 76 
     | 
    
         
            +
                                author: publisher,
         
     | 
| 
      
 77 
     | 
    
         
            +
                            };
         
     | 
| 
      
 78 
     | 
    
         
            +
                        })
         
     | 
| 
      
 79 
     | 
    
         
            +
                        .filter((item) => item && item.link); // 过滤掉空项目和没有链接的项目
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                    // 获取每篇文章的详细内容
         
     | 
| 
      
 82 
     | 
    
         
            +
                    const items = await Promise.all(
         
     | 
| 
      
 83 
     | 
    
         
            +
                        list.map((item) =>
         
     | 
| 
      
 84 
     | 
    
         
            +
                            item
         
     | 
| 
      
 85 
     | 
    
         
            +
                                ? cache.tryGet(item.link, async () => {
         
     | 
| 
      
 86 
     | 
    
         
            +
                                      try {
         
     | 
| 
      
 87 
     | 
    
         
            +
                                          const { data: response } = await got(item.link);
         
     | 
| 
      
 88 
     | 
    
         
            +
                                          const $ = load(response);
         
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
                                          // 优化内容选择器逻辑,避免重复选择
         
     | 
| 
      
 91 
     | 
    
         
            +
                                          let description = $('.wp_articlecontent').html() || $('.body-news-detail').html();
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                                          description = description || item.title;
         
     | 
| 
      
 94 
     | 
    
         
            +
                                          item.description = description;
         
     | 
| 
      
 95 
     | 
    
         
            +
                                      } catch {
         
     | 
| 
      
 96 
     | 
    
         
            +
                                          // 如果获取详细内容失败,返回基本信息
         
     | 
| 
      
 97 
     | 
    
         
            +
                                          item.description = item.title + ' (获取详细内容失败)';
         
     | 
| 
      
 98 
     | 
    
         
            +
                                      }
         
     | 
| 
      
 99 
     | 
    
         
            +
                                      return item;
         
     | 
| 
      
 100 
     | 
    
         
            +
                                  })
         
     | 
| 
      
 101 
     | 
    
         
            +
                                : null
         
     | 
| 
      
 102 
     | 
    
         
            +
                        )
         
     | 
| 
      
 103 
     | 
    
         
            +
                    );
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                    return {
         
     | 
| 
      
 106 
     | 
    
         
            +
                        // 源标题
         
     | 
| 
      
 107 
     | 
    
         
            +
                        title: `南开大学计算机学院-${categoryName}`,
         
     | 
| 
      
 108 
     | 
    
         
            +
                        // 源链接
         
     | 
| 
      
 109 
     | 
    
         
            +
                        link: `${baseUrl}/${type}/list.htm`,
         
     | 
| 
      
 110 
     | 
    
         
            +
                        // 源文章
         
     | 
| 
      
 111 
     | 
    
         
            +
                        item: items,
         
     | 
| 
      
 112 
     | 
    
         
            +
                    };
         
     | 
| 
      
 113 
     | 
    
         
            +
                },
         
     | 
| 
      
 114 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,131 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Route } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import got from '@/utils/got';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { load } from 'cheerio';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { parseDate } from '@/utils/parse-date';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import cache from '@/utils/cache';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import timezone from '@/utils/timezone';
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                path: '/jwc',
         
     | 
| 
      
 10 
     | 
    
         
            +
                categories: ['university'],
         
     | 
| 
      
 11 
     | 
    
         
            +
                example: '/nankai/jwc',
         
     | 
| 
      
 12 
     | 
    
         
            +
                parameters: {},
         
     | 
| 
      
 13 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 20 
     | 
    
         
            +
                },
         
     | 
| 
      
 21 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 22 
     | 
    
         
            +
                    {
         
     | 
| 
      
 23 
     | 
    
         
            +
                        source: ['jwc.nankai.edu.cn/tzgg/list.htm'],
         
     | 
| 
      
 24 
     | 
    
         
            +
                        target: '/jwc',
         
     | 
| 
      
 25 
     | 
    
         
            +
                    },
         
     | 
| 
      
 26 
     | 
    
         
            +
                ],
         
     | 
| 
      
 27 
     | 
    
         
            +
                name: '教务处通知公告',
         
     | 
| 
      
 28 
     | 
    
         
            +
                maintainers: ['vicguo0724'],
         
     | 
| 
      
 29 
     | 
    
         
            +
                description: '南开大学教务处通知公告',
         
     | 
| 
      
 30 
     | 
    
         
            +
                url: 'jwc.nankai.edu.cn',
         
     | 
| 
      
 31 
     | 
    
         
            +
                handler: async () => {
         
     | 
| 
      
 32 
     | 
    
         
            +
                    const baseUrl = 'https://jwc.nankai.edu.cn';
         
     | 
| 
      
 33 
     | 
    
         
            +
                    const { data: response } = await got(`${baseUrl}/tzgg/list.htm`);
         
     | 
| 
      
 34 
     | 
    
         
            +
                    const $ = load(response);
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                    // 解析列表页面中的所有通知项
         
     | 
| 
      
 37 
     | 
    
         
            +
                    const list = $('.page-con-list-news .item')
         
     | 
| 
      
 38 
     | 
    
         
            +
                        .toArray()
         
     | 
| 
      
 39 
     | 
    
         
            +
                        .map((item) => {
         
     | 
| 
      
 40 
     | 
    
         
            +
                            const $item = $(item);
         
     | 
| 
      
 41 
     | 
    
         
            +
                            const $link = $item.find('.t a');
         
     | 
| 
      
 42 
     | 
    
         
            +
                            const $dateDay = $item.find('.d .d-d');
         
     | 
| 
      
 43 
     | 
    
         
            +
                            const $dateMonth = $item.find('.d .d-m');
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                            // 构建完整的日期
         
     | 
| 
      
 46 
     | 
    
         
            +
                            const day = $dateDay.text().trim(); // 格式:04
         
     | 
| 
      
 47 
     | 
    
         
            +
                            const monthYear = $dateMonth.text().trim(); // 格式:2025/06
         
     | 
| 
      
 48 
     | 
    
         
            +
                            const fullDate = `${monthYear}/${day}`; // 2025/06/04
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                            let linkStr = $link.attr('href');
         
     | 
| 
      
 51 
     | 
    
         
            +
                            // 处理相对链接
         
     | 
| 
      
 52 
     | 
    
         
            +
                            if (linkStr && !linkStr.startsWith('http')) {
         
     | 
| 
      
 53 
     | 
    
         
            +
                                linkStr = `${baseUrl}${linkStr}`;
         
     | 
| 
      
 54 
     | 
    
         
            +
                            }
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                            return {
         
     | 
| 
      
 57 
     | 
    
         
            +
                                title: $link.text().trim(),
         
     | 
| 
      
 58 
     | 
    
         
            +
                                link: linkStr,
         
     | 
| 
      
 59 
     | 
    
         
            +
                                pubDate: timezone(parseDate(fullDate, 'YYYY/MM/DD'), +8),
         
     | 
| 
      
 60 
     | 
    
         
            +
                            };
         
     | 
| 
      
 61 
     | 
    
         
            +
                        })
         
     | 
| 
      
 62 
     | 
    
         
            +
                        .filter((item) => item.link); // 过滤掉没有链接的项目
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                    // 获取每个通知的详细内容
         
     | 
| 
      
 65 
     | 
    
         
            +
                    const items = await Promise.all(
         
     | 
| 
      
 66 
     | 
    
         
            +
                        list.map((item) =>
         
     | 
| 
      
 67 
     | 
    
         
            +
                            cache.tryGet(item.link, async () => {
         
     | 
| 
      
 68 
     | 
    
         
            +
                                try {
         
     | 
| 
      
 69 
     | 
    
         
            +
                                    const { data: response } = await got(item.link);
         
     | 
| 
      
 70 
     | 
    
         
            +
                                    const $ = load(response);
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
                                    // 获取发布时间(更精确的时间)
         
     | 
| 
      
 73 
     | 
    
         
            +
                                    const publishTimeText = $('.page-news-souse').text();
         
     | 
| 
      
 74 
     | 
    
         
            +
                                    const timeMatch = publishTimeText.match(/发布时间:(\d{4}-\d{2}-\d{2})/);
         
     | 
| 
      
 75 
     | 
    
         
            +
                                    if (timeMatch) {
         
     | 
| 
      
 76 
     | 
    
         
            +
                                        item.pubDate = timezone(parseDate(timeMatch[1]), +8);
         
     | 
| 
      
 77 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                                    // 获取文章内容
         
     | 
| 
      
 80 
     | 
    
         
            +
                                    const content = $('.page-news-con .wp_articlecontent');
         
     | 
| 
      
 81 
     | 
    
         
            +
                                    if (content.length > 0) {
         
     | 
| 
      
 82 
     | 
    
         
            +
                                        // 处理PDF链接,转换为绝对链接
         
     | 
| 
      
 83 
     | 
    
         
            +
                                        content.find('a').each((i, el) => {
         
     | 
| 
      
 84 
     | 
    
         
            +
                                            const $el = $(el);
         
     | 
| 
      
 85 
     | 
    
         
            +
                                            const href = $el.attr('href');
         
     | 
| 
      
 86 
     | 
    
         
            +
                                            if (href && !href.startsWith('http')) {
         
     | 
| 
      
 87 
     | 
    
         
            +
                                                if (href.startsWith('/')) {
         
     | 
| 
      
 88 
     | 
    
         
            +
                                                    $el.attr('href', `${baseUrl}${href}`);
         
     | 
| 
      
 89 
     | 
    
         
            +
                                                } else {
         
     | 
| 
      
 90 
     | 
    
         
            +
                                                    $el.attr('href', `${baseUrl}/${href}`);
         
     | 
| 
      
 91 
     | 
    
         
            +
                                                }
         
     | 
| 
      
 92 
     | 
    
         
            +
                                            }
         
     | 
| 
      
 93 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
                                        // 处理PDF播放器div,提取PDF链接
         
     | 
| 
      
 96 
     | 
    
         
            +
                                        content.find('.wp_pdf_player').each((i, el) => {
         
     | 
| 
      
 97 
     | 
    
         
            +
                                            const $el = $(el);
         
     | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
      
 99 
     | 
    
         
            +
                                            const pdfSrc = $el.attr('pdfsrc');
         
     | 
| 
      
 100 
     | 
    
         
            +
                                            const sudyfileAttr = ($(el).attr('sudyfile-attr') || '{}').replaceAll("'", '"');
         
     | 
| 
      
 101 
     | 
    
         
            +
                                            const sudyfileAttrJson = JSON.parse(sudyfileAttr);
         
     | 
| 
      
 102 
     | 
    
         
            +
                                            const fileName = sudyfileAttrJson.title || '未命名文件.pdf';
         
     | 
| 
      
 103 
     | 
    
         
            +
                                            if (pdfSrc) {
         
     | 
| 
      
 104 
     | 
    
         
            +
                                                let pdfUrl = pdfSrc;
         
     | 
| 
      
 105 
     | 
    
         
            +
                                                if (!pdfUrl.startsWith('http')) {
         
     | 
| 
      
 106 
     | 
    
         
            +
                                                    pdfUrl = `${baseUrl}${pdfUrl}`;
         
     | 
| 
      
 107 
     | 
    
         
            +
                                                }
         
     | 
| 
      
 108 
     | 
    
         
            +
                                                // 替换PDF播放器为下载链接
         
     | 
| 
      
 109 
     | 
    
         
            +
                                                $el.replaceWith(`<p><a href="${pdfUrl}" target="_blank">${fileName}</a></p>`);
         
     | 
| 
      
 110 
     | 
    
         
            +
                                            }
         
     | 
| 
      
 111 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
                                        item.description = content.html();
         
     | 
| 
      
 114 
     | 
    
         
            +
                                    } else {
         
     | 
| 
      
 115 
     | 
    
         
            +
                                        item.description = '无法获取内容详情';
         
     | 
| 
      
 116 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 117 
     | 
    
         
            +
                                } catch {
         
     | 
| 
      
 118 
     | 
    
         
            +
                                    item.description = '获取内容失败';
         
     | 
| 
      
 119 
     | 
    
         
            +
                                }
         
     | 
| 
      
 120 
     | 
    
         
            +
                                return item;
         
     | 
| 
      
 121 
     | 
    
         
            +
                            })
         
     | 
| 
      
 122 
     | 
    
         
            +
                        )
         
     | 
| 
      
 123 
     | 
    
         
            +
                    );
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
                    return {
         
     | 
| 
      
 126 
     | 
    
         
            +
                        title: '南开大学教务处-通知公告',
         
     | 
| 
      
 127 
     | 
    
         
            +
                        link: `${baseUrl}/tzgg/list.htm`,
         
     | 
| 
      
 128 
     | 
    
         
            +
                        item: items,
         
     | 
| 
      
 129 
     | 
    
         
            +
                    };
         
     | 
| 
      
 130 
     | 
    
         
            +
                },
         
     | 
| 
      
 131 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,84 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Route } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import got from '@/utils/got';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { load } from 'cheerio';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { parseDate } from '@/utils/parse-date';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import cache from '@/utils/cache';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import timezone from '@/utils/timezone';
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                path: '/notice',
         
     | 
| 
      
 10 
     | 
    
         
            +
                categories: ['university'],
         
     | 
| 
      
 11 
     | 
    
         
            +
                example: '/nankai/notice',
         
     | 
| 
      
 12 
     | 
    
         
            +
                parameters: {},
         
     | 
| 
      
 13 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                    antiCrawler: true,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 20 
     | 
    
         
            +
                },
         
     | 
| 
      
 21 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 22 
     | 
    
         
            +
                    {
         
     | 
| 
      
 23 
     | 
    
         
            +
                        source: ['www.nankai.edu.cn', 'www.nankai.edu.cn/157/list.htm'],
         
     | 
| 
      
 24 
     | 
    
         
            +
                    },
         
     | 
| 
      
 25 
     | 
    
         
            +
                ],
         
     | 
| 
      
 26 
     | 
    
         
            +
                name: '通知公告',
         
     | 
| 
      
 27 
     | 
    
         
            +
                maintainers: ['vicguo0724'],
         
     | 
| 
      
 28 
     | 
    
         
            +
                handler: async () => {
         
     | 
| 
      
 29 
     | 
    
         
            +
                    const baseUrl = 'https://www.nankai.edu.cn';
         
     | 
| 
      
 30 
     | 
    
         
            +
                    const listUrl = `${baseUrl}/157/list.htm`;
         
     | 
| 
      
 31 
     | 
    
         
            +
                    const { data: response } = await got(listUrl);
         
     | 
| 
      
 32 
     | 
    
         
            +
                    const $ = load(response);
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                    const list = $('ul.newslist li')
         
     | 
| 
      
 35 
     | 
    
         
            +
                        .toArray()
         
     | 
| 
      
 36 
     | 
    
         
            +
                        .map((item) => {
         
     | 
| 
      
 37 
     | 
    
         
            +
                            const $item = $(item);
         
     | 
| 
      
 38 
     | 
    
         
            +
                            const $time = $item.find('.time');
         
     | 
| 
      
 39 
     | 
    
         
            +
                            const day = $time.find('.time-d').text().trim();
         
     | 
| 
      
 40 
     | 
    
         
            +
                            const monthYear = $time.contents().last().text().trim();
         
     | 
| 
      
 41 
     | 
    
         
            +
                            const pubDate = timezone(parseDate(`${monthYear}-${day}`, 'YYYY-MM-DD'), +8);
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                            const $link = $item.find('.tit a');
         
     | 
| 
      
 44 
     | 
    
         
            +
                            let href = $link.attr('href') || '';
         
     | 
| 
      
 45 
     | 
    
         
            +
                            href = href.startsWith('http') ? href : new URL(href, baseUrl).href;
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                            return {
         
     | 
| 
      
 48 
     | 
    
         
            +
                                title: $link.text().trim(),
         
     | 
| 
      
 49 
     | 
    
         
            +
                                link: href,
         
     | 
| 
      
 50 
     | 
    
         
            +
                                pubDate,
         
     | 
| 
      
 51 
     | 
    
         
            +
                            };
         
     | 
| 
      
 52 
     | 
    
         
            +
                        });
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                    const items = await Promise.all(
         
     | 
| 
      
 55 
     | 
    
         
            +
                        list.map((item) =>
         
     | 
| 
      
 56 
     | 
    
         
            +
                            cache.tryGet(item.link, async () => {
         
     | 
| 
      
 57 
     | 
    
         
            +
                                try {
         
     | 
| 
      
 58 
     | 
    
         
            +
                                    // 判断link如果是https://xb.nankai.edu.cn/的则为校内访问的
         
     | 
| 
      
 59 
     | 
    
         
            +
                                    if (item.link.includes('xb.nankai.edu.cn')) {
         
     | 
| 
      
 60 
     | 
    
         
            +
                                        item.description = '该通知可能需要校内访问权限';
         
     | 
| 
      
 61 
     | 
    
         
            +
                                    } else {
         
     | 
| 
      
 62 
     | 
    
         
            +
                                        const { data: detailResponse } = await got(item.link);
         
     | 
| 
      
 63 
     | 
    
         
            +
                                        const $detail = load(detailResponse);
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                                        // 提取正文内容
         
     | 
| 
      
 66 
     | 
    
         
            +
                                        const content = $detail('.wp_articlecontent').html() || '';
         
     | 
| 
      
 67 
     | 
    
         
            +
                                        item.description = content;
         
     | 
| 
      
 68 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 69 
     | 
    
         
            +
                                } catch {
         
     | 
| 
      
 70 
     | 
    
         
            +
                                    // 如果提取正文内容失败,则返回默认内容
         
     | 
| 
      
 71 
     | 
    
         
            +
                                    item.description = '正文内容获取失败';
         
     | 
| 
      
 72 
     | 
    
         
            +
                                }
         
     | 
| 
      
 73 
     | 
    
         
            +
                                return item;
         
     | 
| 
      
 74 
     | 
    
         
            +
                            })
         
     | 
| 
      
 75 
     | 
    
         
            +
                        )
         
     | 
| 
      
 76 
     | 
    
         
            +
                    );
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
                    return {
         
     | 
| 
      
 79 
     | 
    
         
            +
                        title: '南开大学通知公告',
         
     | 
| 
      
 80 
     | 
    
         
            +
                        link: listUrl,
         
     | 
| 
      
 81 
     | 
    
         
            +
                        item: items,
         
     | 
| 
      
 82 
     | 
    
         
            +
                    };
         
     | 
| 
      
 83 
     | 
    
         
            +
                },
         
     | 
| 
      
 84 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,97 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Route } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import got from '@/utils/got';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { load } from 'cheerio';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { parseDate } from '@/utils/parse-date';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import cache from '@/utils/cache';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import timezone from '@/utils/timezone';
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                path: '/yzb/:type?',
         
     | 
| 
      
 10 
     | 
    
         
            +
                categories: ['university'],
         
     | 
| 
      
 11 
     | 
    
         
            +
                example: '/nankai/yzb/5509',
         
     | 
| 
      
 12 
     | 
    
         
            +
                parameters: { type: '栏目名(若为空则默认为“硕士招生”)' },
         
     | 
| 
      
 13 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 20 
     | 
    
         
            +
                },
         
     | 
| 
      
 21 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 22 
     | 
    
         
            +
                    {
         
     | 
| 
      
 23 
     | 
    
         
            +
                        source: ['yzb.nankai.edu.cn', 'yzb.nankai.edu.cn/:type/list.htm'],
         
     | 
| 
      
 24 
     | 
    
         
            +
                        target: '/yzb/:type?',
         
     | 
| 
      
 25 
     | 
    
         
            +
                    },
         
     | 
| 
      
 26 
     | 
    
         
            +
                ],
         
     | 
| 
      
 27 
     | 
    
         
            +
                name: '研究生招生网',
         
     | 
| 
      
 28 
     | 
    
         
            +
                maintainers: ['sddzhyc'],
         
     | 
| 
      
 29 
     | 
    
         
            +
                description: `| 硕士招生 | 博士招生 | 港澳台研究生最新信息 |
         
     | 
| 
      
 30 
     | 
    
         
            +
            | -------- | -------- | -------- |
         
     | 
| 
      
 31 
     | 
    
         
            +
            | 5509     | 2552    | 2562   |`,
         
     | 
| 
      
 32 
     | 
    
         
            +
                url: 'yzb.nankai.edu.cn',
         
     | 
| 
      
 33 
     | 
    
         
            +
                handler: async (ctx) => {
         
     | 
| 
      
 34 
     | 
    
         
            +
                    // 从 URL 参数中获取通知分类
         
     | 
| 
      
 35 
     | 
    
         
            +
                    const { type = '5509' } = ctx.req.param();
         
     | 
| 
      
 36 
     | 
    
         
            +
                    const baseUrl = 'https://yzb.nankai.edu.cn';
         
     | 
| 
      
 37 
     | 
    
         
            +
                    const { data: response } = await got(`${baseUrl}/${type}/list.htm`);
         
     | 
| 
      
 38 
     | 
    
         
            +
                    const $ = load(response);
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                    // 先转换为数组,再使用原生JavaScript的map
         
     | 
| 
      
 41 
     | 
    
         
            +
                    const dateList = $('#wp_news_w9')
         
     | 
| 
      
 42 
     | 
    
         
            +
                        .find('span.col_news_date')
         
     | 
| 
      
 43 
     | 
    
         
            +
                        .toArray()
         
     | 
| 
      
 44 
     | 
    
         
            +
                        .map((item) => $(item).text());
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                    const list = $('#wp_news_w9')
         
     | 
| 
      
 47 
     | 
    
         
            +
                        .find('a[title]')
         
     | 
| 
      
 48 
     | 
    
         
            +
                        .toArray()
         
     | 
| 
      
 49 
     | 
    
         
            +
                        .map((element, index) => {
         
     | 
| 
      
 50 
     | 
    
         
            +
                            const $a = $(element);
         
     | 
| 
      
 51 
     | 
    
         
            +
                            let linkStr = $a.attr('href') || '';
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                            // 使用三元表达式处理链接
         
     | 
| 
      
 54 
     | 
    
         
            +
                            linkStr = linkStr.startsWith('http://') ? linkStr.replace('http://', 'https://') : `${baseUrl}${linkStr}`;
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                            return {
         
     | 
| 
      
 57 
     | 
    
         
            +
                                title: $a.text(),
         
     | 
| 
      
 58 
     | 
    
         
            +
                                link: linkStr,
         
     | 
| 
      
 59 
     | 
    
         
            +
                                pubDate: timezone(parseDate(dateList[index]), +8),
         
     | 
| 
      
 60 
     | 
    
         
            +
                            };
         
     | 
| 
      
 61 
     | 
    
         
            +
                        });
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                    const items = await Promise.all(
         
     | 
| 
      
 64 
     | 
    
         
            +
                        list.map((item) =>
         
     | 
| 
      
 65 
     | 
    
         
            +
                            cache.tryGet(item.link.toString(), async () => {
         
     | 
| 
      
 66 
     | 
    
         
            +
                                const { data: response } = await got(item.link);
         
     | 
| 
      
 67 
     | 
    
         
            +
                                const $ = load(response);
         
     | 
| 
      
 68 
     | 
    
         
            +
                                item.description = $('.read').first().html();
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
                                // 提取PDF链接,先转换为数组再使用map
         
     | 
| 
      
 71 
     | 
    
         
            +
                                const pdfLinks = $('div[pdfsrc$=".pdf"]')
         
     | 
| 
      
 72 
     | 
    
         
            +
                                    .toArray()
         
     | 
| 
      
 73 
     | 
    
         
            +
                                    .map((el) => {
         
     | 
| 
      
 74 
     | 
    
         
            +
                                        const pdfUrl = $(el).attr('pdfsrc') || '';
         
     | 
| 
      
 75 
     | 
    
         
            +
                                        const sudyfileAttr = ($(el).attr('sudyfile-attr') || '{}').replaceAll("'", '"');
         
     | 
| 
      
 76 
     | 
    
         
            +
                                        const sudyfileAttrJson = JSON.parse(sudyfileAttr);
         
     | 
| 
      
 77 
     | 
    
         
            +
                                        const fileName = sudyfileAttrJson.title || '未命名文件.pdf';
         
     | 
| 
      
 78 
     | 
    
         
            +
                                        return `<a href="${new URL(pdfUrl, baseUrl).href}">${fileName}</a>`;
         
     | 
| 
      
 79 
     | 
    
         
            +
                                    })
         
     | 
| 
      
 80 
     | 
    
         
            +
                                    .join('<br>');
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                                if (pdfLinks) {
         
     | 
| 
      
 83 
     | 
    
         
            +
                                    item.description += `<h4>相关附件:</h4>${pdfLinks}`;
         
     | 
| 
      
 84 
     | 
    
         
            +
                                }
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
                                return item;
         
     | 
| 
      
 87 
     | 
    
         
            +
                            })
         
     | 
| 
      
 88 
     | 
    
         
            +
                        )
         
     | 
| 
      
 89 
     | 
    
         
            +
                    );
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                    return {
         
     | 
| 
      
 92 
     | 
    
         
            +
                        title: `南开大学研究生招生网-${$('.column-title').text()}`,
         
     | 
| 
      
 93 
     | 
    
         
            +
                        link: `${baseUrl}/${type}/list.htm`,
         
     | 
| 
      
 94 
     | 
    
         
            +
                        item: items as any[],
         
     | 
| 
      
 95 
     | 
    
         
            +
                    };
         
     | 
| 
      
 96 
     | 
    
         
            +
                },
         
     | 
| 
      
 97 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,172 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { DataItem, Route } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import cache from '@/utils/cache';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import got from '@/utils/got';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { load } from 'cheerio';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { parseDate } from '@/utils/parse-date';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import timezone from '@/utils/timezone';
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            const BASE_URL = 'http://yz.neu.edu.cn';
         
     | 
| 
      
 9 
     | 
    
         
            +
            const DOWNLOAD_ID = 5792;
         
     | 
| 
      
 10 
     | 
    
         
            +
            const MASTER1_ID = 5932;
         
     | 
| 
      
 11 
     | 
    
         
            +
            const MASTER2_ID = 5933;
         
     | 
| 
      
 12 
     | 
    
         
            +
            const PhD1_ID = 5945;
         
     | 
| 
      
 13 
     | 
    
         
            +
            const PhD2_ID = 5946;
         
     | 
| 
      
 14 
     | 
    
         
            +
            const DOWNLOAD_AUTHOR = '研招办';
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const idMp = {
         
     | 
| 
      
 17 
     | 
    
         
            +
                download: DOWNLOAD_ID,
         
     | 
| 
      
 18 
     | 
    
         
            +
                master1: MASTER1_ID,
         
     | 
| 
      
 19 
     | 
    
         
            +
                master2: MASTER2_ID,
         
     | 
| 
      
 20 
     | 
    
         
            +
                phd1: PhD1_ID,
         
     | 
| 
      
 21 
     | 
    
         
            +
                phd2: PhD2_ID,
         
     | 
| 
      
 22 
     | 
    
         
            +
            };
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
            const parsePage = async (items, type) => {
         
     | 
| 
      
 25 
     | 
    
         
            +
                const results = await Promise.all(
         
     | 
| 
      
 26 
     | 
    
         
            +
                    items.map(async (item) => {
         
     | 
| 
      
 27 
     | 
    
         
            +
                        const $ = load(item);
         
     | 
| 
      
 28 
     | 
    
         
            +
                        const aTag = $('span.Article_Title > a');
         
     | 
| 
      
 29 
     | 
    
         
            +
                        const title = aTag.attr('title') ?? '';
         
     | 
| 
      
 30 
     | 
    
         
            +
                        const url = BASE_URL + aTag.attr('href');
         
     | 
| 
      
 31 
     | 
    
         
            +
                        const resultItem: DataItem = {
         
     | 
| 
      
 32 
     | 
    
         
            +
                            title,
         
     | 
| 
      
 33 
     | 
    
         
            +
                            link: url,
         
     | 
| 
      
 34 
     | 
    
         
            +
                            description: '',
         
     | 
| 
      
 35 
     | 
    
         
            +
                            pubDate: (() => {
         
     | 
| 
      
 36 
     | 
    
         
            +
                                const sTag = $('span.Article_PublishDate');
         
     | 
| 
      
 37 
     | 
    
         
            +
                                const pubDate = sTag.text() ? timezone(parseDate(sTag.text()), +8) : undefined;
         
     | 
| 
      
 38 
     | 
    
         
            +
                                return pubDate;
         
     | 
| 
      
 39 
     | 
    
         
            +
                            })(),
         
     | 
| 
      
 40 
     | 
    
         
            +
                            author: type === DOWNLOAD_ID ? DOWNLOAD_AUTHOR : '',
         
     | 
| 
      
 41 
     | 
    
         
            +
                        };
         
     | 
| 
      
 42 
     | 
    
         
            +
                        if (type === DOWNLOAD_ID && /\.(pdf|docx?|xlsx?|zip|rar|7z)$/i.test(url)) {
         
     | 
| 
      
 43 
     | 
    
         
            +
                            resultItem.description = `
         
     | 
| 
      
 44 
     | 
    
         
            +
                                    <p>${title}</p><br/>
         
     | 
| 
      
 45 
     | 
    
         
            +
                                    <a href="${url}">点击进入下载地址传送门~</a>
         
     | 
| 
      
 46 
     | 
    
         
            +
                                `;
         
     | 
| 
      
 47 
     | 
    
         
            +
                            return resultItem;
         
     | 
| 
      
 48 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 49 
     | 
    
         
            +
                            return await cache.tryGet(url, async () => {
         
     | 
| 
      
 50 
     | 
    
         
            +
                                const result = await got(url);
         
     | 
| 
      
 51 
     | 
    
         
            +
                                const $ = load(result.data);
         
     | 
| 
      
 52 
     | 
    
         
            +
                                const description = cleanEntryContent($);
         
     | 
| 
      
 53 
     | 
    
         
            +
                                resultItem.description = description;
         
     | 
| 
      
 54 
     | 
    
         
            +
                                if (type !== DOWNLOAD_ID) {
         
     | 
| 
      
 55 
     | 
    
         
            +
                                    const dateText = $('.arti_update')
         
     | 
| 
      
 56 
     | 
    
         
            +
                                        .text()
         
     | 
| 
      
 57 
     | 
    
         
            +
                                        .match(/(\d{4}-\d{2}-\d{2})/);
         
     | 
| 
      
 58 
     | 
    
         
            +
                                    const date = dateText ? dateText[1] : '';
         
     | 
| 
      
 59 
     | 
    
         
            +
                                    const authorText = $('.arti_publisher')
         
     | 
| 
      
 60 
     | 
    
         
            +
                                        .text()
         
     | 
| 
      
 61 
     | 
    
         
            +
                                        .match(/[::]?\s*(.+)/);
         
     | 
| 
      
 62 
     | 
    
         
            +
                                    const author = authorText ? authorText[1].trim() : '';
         
     | 
| 
      
 63 
     | 
    
         
            +
                                    resultItem.pubDate = timezone(parseDate(date), +8);
         
     | 
| 
      
 64 
     | 
    
         
            +
                                    resultItem.author = author;
         
     | 
| 
      
 65 
     | 
    
         
            +
                                }
         
     | 
| 
      
 66 
     | 
    
         
            +
                                return resultItem;
         
     | 
| 
      
 67 
     | 
    
         
            +
                            });
         
     | 
| 
      
 68 
     | 
    
         
            +
                        }
         
     | 
| 
      
 69 
     | 
    
         
            +
                    })
         
     | 
| 
      
 70 
     | 
    
         
            +
                );
         
     | 
| 
      
 71 
     | 
    
         
            +
                return results;
         
     | 
| 
      
 72 
     | 
    
         
            +
            };
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
            const handler = async (ctx) => {
         
     | 
| 
      
 75 
     | 
    
         
            +
                let type = ctx.req.param('type');
         
     | 
| 
      
 76 
     | 
    
         
            +
                if (idMp[type]) {
         
     | 
| 
      
 77 
     | 
    
         
            +
                    type = idMp[type];
         
     | 
| 
      
 78 
     | 
    
         
            +
                }
         
     | 
| 
      
 79 
     | 
    
         
            +
                const newsUrl = `${BASE_URL}/${type}/list.htm`;
         
     | 
| 
      
 80 
     | 
    
         
            +
                const response = await got(newsUrl);
         
     | 
| 
      
 81 
     | 
    
         
            +
                const data = response.data;
         
     | 
| 
      
 82 
     | 
    
         
            +
                const $ = load(data);
         
     | 
| 
      
 83 
     | 
    
         
            +
                const title = $('title').text();
         
     | 
| 
      
 84 
     | 
    
         
            +
                const items = $('div.col_news_list ul.wp_article_list li').toArray();
         
     | 
| 
      
 85 
     | 
    
         
            +
                const results = await parsePage(items, type);
         
     | 
| 
      
 86 
     | 
    
         
            +
                return {
         
     | 
| 
      
 87 
     | 
    
         
            +
                    title: `${title}-东北大学研究生招生信息网`,
         
     | 
| 
      
 88 
     | 
    
         
            +
                    description: title,
         
     | 
| 
      
 89 
     | 
    
         
            +
                    link: BASE_URL,
         
     | 
| 
      
 90 
     | 
    
         
            +
                    item: results,
         
     | 
| 
      
 91 
     | 
    
         
            +
                };
         
     | 
| 
      
 92 
     | 
    
         
            +
            };
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
            const cleanEntryContent = ($) => {
         
     | 
| 
      
 95 
     | 
    
         
            +
                const entry = $('.entry');
         
     | 
| 
      
 96 
     | 
    
         
            +
                if (!entry || entry.length === 0) {
         
     | 
| 
      
 97 
     | 
    
         
            +
                    return '';
         
     | 
| 
      
 98 
     | 
    
         
            +
                }
         
     | 
| 
      
 99 
     | 
    
         
            +
                entry.find('span').removeAttr('style').removeAttr('class');
         
     | 
| 
      
 100 
     | 
    
         
            +
                entry.find('div').each((_, el) => {
         
     | 
| 
      
 101 
     | 
    
         
            +
                    const html = $(el).html();
         
     | 
| 
      
 102 
     | 
    
         
            +
                    $(el).replaceWith(html);
         
     | 
| 
      
 103 
     | 
    
         
            +
                });
         
     | 
| 
      
 104 
     | 
    
         
            +
                entry.find('p').removeAttr('style').removeAttr('class');
         
     | 
| 
      
 105 
     | 
    
         
            +
                entry.find('a').removeAttr('style').removeAttr('class');
         
     | 
| 
      
 106 
     | 
    
         
            +
                entry.find('td').removeAttr('bgcolor');
         
     | 
| 
      
 107 
     | 
    
         
            +
                entry.find('img').each((_, el) => {
         
     | 
| 
      
 108 
     | 
    
         
            +
                    const src = $(el).attr('src');
         
     | 
| 
      
 109 
     | 
    
         
            +
                    const alt = $(el).attr('alt') || '';
         
     | 
| 
      
 110 
     | 
    
         
            +
                    $(el).replaceWith(`<img src="${src}" alt="${alt}" />`);
         
     | 
| 
      
 111 
     | 
    
         
            +
                });
         
     | 
| 
      
 112 
     | 
    
         
            +
                entry.find('.wp_pdf_player').each((_, el) => {
         
     | 
| 
      
 113 
     | 
    
         
            +
                    const url = BASE_URL + $(el).attr('pdfsrc');
         
     | 
| 
      
 114 
     | 
    
         
            +
                    $(el).replaceWith(
         
     | 
| 
      
 115 
     | 
    
         
            +
                        `
         
     | 
| 
      
 116 
     | 
    
         
            +
                        <p>点击进入文件传送门~:<a href="${url}">查看文件</a></p>
         
     | 
| 
      
 117 
     | 
    
         
            +
                        `
         
     | 
| 
      
 118 
     | 
    
         
            +
                    );
         
     | 
| 
      
 119 
     | 
    
         
            +
                });
         
     | 
| 
      
 120 
     | 
    
         
            +
                entry.find('.wp_video_player').each((_, el) => {
         
     | 
| 
      
 121 
     | 
    
         
            +
                    const div = $(el);
         
     | 
| 
      
 122 
     | 
    
         
            +
                    const src = div.attr('sudy-wp-src');
         
     | 
| 
      
 123 
     | 
    
         
            +
                    if (src) {
         
     | 
| 
      
 124 
     | 
    
         
            +
                        const videoUrl = BASE_URL + src;
         
     | 
| 
      
 125 
     | 
    
         
            +
                        const widthMatch = div.attr('style')?.match(/width:\s*(\d+)px/);
         
     | 
| 
      
 126 
     | 
    
         
            +
                        const width = widthMatch && widthMatch[1] ? widthMatch[1] : '600';
         
     | 
| 
      
 127 
     | 
    
         
            +
                        const heightMatch = div.attr('style')?.match(/height:\s*(\d+)px/);
         
     | 
| 
      
 128 
     | 
    
         
            +
                        const height = heightMatch && heightMatch[1] ? heightMatch[1] : '400';
         
     | 
| 
      
 129 
     | 
    
         
            +
                        const videoTag = `
         
     | 
| 
      
 130 
     | 
    
         
            +
                            <video controls width="${width}" height="${height}" style="max-width: 100%;margin-left: auto;margin-right: auto;">
         
     | 
| 
      
 131 
     | 
    
         
            +
                                <source src="${videoUrl}" type="video/mp4">
         
     | 
| 
      
 132 
     | 
    
         
            +
                                您的浏览器不支持 video 标签。
         
     | 
| 
      
 133 
     | 
    
         
            +
                            </video>
         
     | 
| 
      
 134 
     | 
    
         
            +
                        `;
         
     | 
| 
      
 135 
     | 
    
         
            +
                        div.replaceWith(videoTag);
         
     | 
| 
      
 136 
     | 
    
         
            +
                    }
         
     | 
| 
      
 137 
     | 
    
         
            +
                });
         
     | 
| 
      
 138 
     | 
    
         
            +
                return entry.html();
         
     | 
| 
      
 139 
     | 
    
         
            +
            };
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 142 
     | 
    
         
            +
                path: '/yz/:type',
         
     | 
| 
      
 143 
     | 
    
         
            +
                categories: ['university'],
         
     | 
| 
      
 144 
     | 
    
         
            +
                example: '/neu/yz/master1',
         
     | 
| 
      
 145 
     | 
    
         
            +
                parameters: { type: '分类id,见下表' },
         
     | 
| 
      
 146 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 147 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 148 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 149 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 150 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 151 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 152 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 153 
     | 
    
         
            +
                },
         
     | 
| 
      
 154 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 155 
     | 
    
         
            +
                    {
         
     | 
| 
      
 156 
     | 
    
         
            +
                        source: ['yz.neu.edu.cn/:type/list.htm'],
         
     | 
| 
      
 157 
     | 
    
         
            +
                        target: '/yz/:type',
         
     | 
| 
      
 158 
     | 
    
         
            +
                    },
         
     | 
| 
      
 159 
     | 
    
         
            +
                ],
         
     | 
| 
      
 160 
     | 
    
         
            +
                name: '研究生招生信息网',
         
     | 
| 
      
 161 
     | 
    
         
            +
                url: 'yz.neu.edu.cn',
         
     | 
| 
      
 162 
     | 
    
         
            +
                maintainers: ['paintstar'],
         
     | 
| 
      
 163 
     | 
    
         
            +
                handler,
         
     | 
| 
      
 164 
     | 
    
         
            +
                description: `
         
     | 
| 
      
 165 
     | 
    
         
            +
            | 分类名                     | 分类id      |
         
     | 
| 
      
 166 
     | 
    
         
            +
            | ------------------------- | ---------- |
         
     | 
| 
      
 167 
     | 
    
         
            +
            | 硕士公告                   | master1     |
         
     | 
| 
      
 168 
     | 
    
         
            +
            | 硕士简章                   | master2     |
         
     | 
| 
      
 169 
     | 
    
         
            +
            | 博士公告                   | phd1        |
         
     | 
| 
      
 170 
     | 
    
         
            +
            | 博士简章                   | phd2        |
         
     | 
| 
      
 171 
     | 
    
         
            +
            | 下载中心                   | download    |`,
         
     | 
| 
      
 172 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Data, Route, ViewType } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { fetchCollection, rootUrl } from './utils';
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 5 
     | 
    
         
            +
                path: '/explainer',
         
     | 
| 
      
 6 
     | 
    
         
            +
                view: ViewType.Articles,
         
     | 
| 
      
 7 
     | 
    
         
            +
                categories: ['new-media'],
         
     | 
| 
      
 8 
     | 
    
         
            +
                example: '/newslaundry/explainer',
         
     | 
| 
      
 9 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 12 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 13 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 14 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                },
         
     | 
| 
      
 17 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 18 
     | 
    
         
            +
                    {
         
     | 
| 
      
 19 
     | 
    
         
            +
                        source: ['newslaundry.com/explainer'],
         
     | 
| 
      
 20 
     | 
    
         
            +
                        target: '/explainer',
         
     | 
| 
      
 21 
     | 
    
         
            +
                    },
         
     | 
| 
      
 22 
     | 
    
         
            +
                ],
         
     | 
| 
      
 23 
     | 
    
         
            +
                name: 'Explainer',
         
     | 
| 
      
 24 
     | 
    
         
            +
                maintainers: ['Rjnishant530'],
         
     | 
| 
      
 25 
     | 
    
         
            +
                handler,
         
     | 
| 
      
 26 
     | 
    
         
            +
            };
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            async function handler(): Promise<Data> {
         
     | 
| 
      
 29 
     | 
    
         
            +
                return await fetchCollection('explainer', `${rootUrl}/explainer`);
         
     | 
| 
      
 30 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Data, Route, ViewType } from '@/types';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { fetchCollection, rootUrl } from './utils';
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            export const route: Route = {
         
     | 
| 
      
 5 
     | 
    
         
            +
                path: '/nl-cheatsheet',
         
     | 
| 
      
 6 
     | 
    
         
            +
                view: ViewType.Articles,
         
     | 
| 
      
 7 
     | 
    
         
            +
                categories: ['new-media'],
         
     | 
| 
      
 8 
     | 
    
         
            +
                example: '/newslaundry/nl-cheatsheet',
         
     | 
| 
      
 9 
     | 
    
         
            +
                features: {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    requireConfig: false,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    requirePuppeteer: false,
         
     | 
| 
      
 12 
     | 
    
         
            +
                    antiCrawler: false,
         
     | 
| 
      
 13 
     | 
    
         
            +
                    supportBT: false,
         
     | 
| 
      
 14 
     | 
    
         
            +
                    supportPodcast: false,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    supportScihub: false,
         
     | 
| 
      
 16 
     | 
    
         
            +
                },
         
     | 
| 
      
 17 
     | 
    
         
            +
                radar: [
         
     | 
| 
      
 18 
     | 
    
         
            +
                    {
         
     | 
| 
      
 19 
     | 
    
         
            +
                        source: ['newslaundry.com/collection/nl-cheatsheet'],
         
     | 
| 
      
 20 
     | 
    
         
            +
                        target: '/nl-cheatsheet',
         
     | 
| 
      
 21 
     | 
    
         
            +
                    },
         
     | 
| 
      
 22 
     | 
    
         
            +
                ],
         
     | 
| 
      
 23 
     | 
    
         
            +
                name: 'Explains',
         
     | 
| 
      
 24 
     | 
    
         
            +
                maintainers: ['Rjnishant530'],
         
     | 
| 
      
 25 
     | 
    
         
            +
                handler,
         
     | 
| 
      
 26 
     | 
    
         
            +
            };
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            async function handler(): Promise<Data> {
         
     | 
| 
      
 29 
     | 
    
         
            +
                return await fetchCollection('nl-cheatsheet', `${rootUrl}/collection/nl-cheatsheet`);
         
     | 
| 
      
 30 
     | 
    
         
            +
            }
         
     |