rsshub 1.0.0-master.cdb6f6f → 1.0.0-master.cdc36d3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +6 -0
- package/lib/middleware/anti-hotlink.js +1 -0
- package/lib/middleware/parameter.js +2 -1
- package/lib/router.js +8 -8
- package/lib/routes/disqus/posts.js +1 -1
- package/lib/routes/fanfou/favorites.js +1 -1
- package/lib/routes/fanfou/home-timeline.js +1 -1
- package/lib/routes/fanfou/public-timeline.js +1 -1
- package/lib/routes/fanfou/user-timeline.js +1 -1
- package/lib/routes/gocomics/index.js +1 -1
- package/lib/routes/lastfm/loved.js +1 -1
- package/lib/routes/lastfm/recent.js +1 -1
- package/lib/routes/lastfm/top.js +1 -1
- package/lib/routes/miniflux/get-entries.js +1 -1
- package/lib/routes/miniflux/get-feeds.js +1 -1
- package/lib/routes/us/supremecourt/argument-audio.js +9 -6
- package/lib/v2/12306/index.js +1 -1
- package/lib/v2/163/music/playlist.js +1 -1
- package/lib/v2/4gamers/category.js +31 -0
- package/lib/v2/4gamers/maintainer.js +6 -0
- package/lib/v2/4gamers/radar.js +31 -0
- package/lib/v2/4gamers/router.js +6 -0
- package/lib/v2/4gamers/tag.js +23 -0
- package/lib/v2/4gamers/templates/description.art +3 -0
- package/lib/v2/4gamers/templates/image.art +3 -0
- package/lib/v2/4gamers/topic.js +22 -0
- package/lib/v2/4gamers/utils.js +73 -0
- package/lib/v2/56kog/class.js +10 -0
- package/lib/v2/56kog/maintainer.js +4 -0
- package/lib/v2/56kog/radar.js +85 -0
- package/lib/v2/56kog/router.js +4 -0
- package/lib/v2/56kog/templates/description.art +32 -0
- package/lib/v2/56kog/top.js +10 -0
- package/lib/v2/56kog/util.js +111 -0
- package/lib/v2/591/list.js +1 -1
- package/lib/v2/acfun/article.js +3 -3
- package/lib/v2/aisixiang/thinktank.js +1 -1
- package/lib/v2/alistapart/radar.js +2 -2
- package/lib/v2/auto-stats/index.js +65 -0
- package/lib/v2/auto-stats/maintainer.js +3 -0
- package/lib/v2/auto-stats/radar.js +35 -0
- package/lib/v2/auto-stats/router.js +3 -0
- package/lib/v2/brooklynmuseum/radar.js +1 -1
- package/lib/v2/bsky/posts.js +1 -1
- package/lib/v2/bulianglin/bulianglin.js +32 -0
- package/lib/v2/bulianglin/maintainer.js +3 -0
- package/lib/v2/bulianglin/radar.js +13 -0
- package/lib/v2/bulianglin/router.js +3 -0
- package/lib/v2/bytes/radar.js +1 -1
- package/lib/v2/caam/index.js +64 -0
- package/lib/v2/caam/maintainer.js +3 -0
- package/lib/v2/caam/radar.js +2677 -0
- package/lib/v2/caam/router.js +3 -0
- package/lib/v2/caixin/weekly.js +8 -2
- package/lib/v2/cas/genetics/index.js +63 -0
- package/lib/v2/cas/maintainer.js +1 -1
- package/lib/v2/cas/radar.js +3 -3
- package/lib/v2/cas/router.js +1 -1
- package/lib/v2/cfmmc/index.js +72 -0
- package/lib/v2/cfmmc/maintainer.js +3 -0
- package/lib/v2/cfmmc/radar.js +17 -0
- package/lib/v2/cfmmc/router.js +3 -0
- package/lib/v2/chinamoney/channels.js +57 -0
- package/lib/v2/chinamoney/maintainer.js +3 -0
- package/lib/v2/chinamoney/notice.js +61 -0
- package/lib/v2/chinamoney/radar.js +11 -0
- package/lib/v2/chinamoney/router.js +3 -0
- package/lib/v2/chuanliu/maintainer.js +3 -0
- package/lib/v2/chuanliu/nice.js +76 -0
- package/lib/v2/chuanliu/radar.js +13 -0
- package/lib/v2/chuanliu/router.js +3 -0
- package/lib/v2/chuanliu/templates/description.art +23 -0
- package/lib/v2/cna/web/index.js +1 -1
- package/lib/v2/cntheory/maintainer.js +3 -0
- package/lib/v2/cntheory/paper.js +87 -0
- package/lib/v2/cntheory/radar.js +13 -0
- package/lib/v2/cntheory/router.js +3 -0
- package/lib/v2/cntheory/templates/description.art +2 -0
- package/lib/v2/comicskingdom/index.js +1 -1
- package/lib/v2/cs/index.js +83 -0
- package/lib/v2/cs/maintainer.js +5 -0
- package/lib/v2/cs/radar.js +229 -0
- package/lib/v2/cs/router.js +13 -0
- package/lib/v2/cs/video.js +70 -0
- package/lib/v2/curiouscat/radar.js +1 -1
- package/lib/v2/daily/radar.js +3 -3
- package/lib/v2/deadline/radar.js +1 -1
- package/lib/v2/discord/radar.js +1 -1
- package/lib/v2/dnaindia/radar.js +2 -2
- package/lib/v2/douban/other/list.js +46 -32
- package/lib/v2/ehentai/favorites.js +1 -1
- package/lib/v2/fansly/maintainer.js +4 -0
- package/lib/v2/fansly/post.js +29 -0
- package/lib/v2/fansly/radar.js +19 -0
- package/lib/v2/fansly/router.js +4 -0
- package/lib/v2/fansly/tag.js +30 -0
- package/lib/v2/fansly/templates/media.art +8 -0
- package/lib/v2/fansly/templates/poll.art +4 -0
- package/lib/v2/fansly/templates/tip-goal.art +2 -0
- package/lib/v2/fansly/utils.js +176 -0
- package/lib/v2/firefox/release.js +13 -7
- package/lib/v2/firefox/router.js +1 -1
- package/lib/v2/fisher-spb/radar.js +1 -1
- package/lib/v2/foresightnews/util.js +1 -1
- package/lib/v2/free/maintainer.js +3 -0
- package/lib/v2/free/radar.js +13 -0
- package/lib/v2/free/router.js +3 -0
- package/lib/v2/free/rss.js +19 -0
- package/lib/v2/freecomputerbooks/radar.js +2 -2
- package/lib/v2/freewechat/profile.js +4 -2
- package/lib/v2/ft/radar.js +1 -1
- package/lib/v2/gdut/news.js +2 -2
- package/lib/v2/github/follower.js +1 -1
- package/lib/v2/github/star.js +1 -1
- package/lib/v2/github/starred-repos.js +1 -1
- package/lib/v2/gov/beijing/bjedu/gh.js +48 -0
- package/lib/v2/gov/maintainer.js +1 -0
- package/lib/v2/gov/radar.js +12 -1
- package/lib/v2/gov/router.js +1 -0
- package/lib/v2/gov/suzhou/news.js +1 -1
- package/lib/v2/guanhai/index.js +15 -10
- package/lib/v2/guokr/channel.js +1 -1
- package/lib/v2/hitwh/today.js +10 -2
- package/lib/v2/huanqiu/index.js +5 -5
- package/lib/v2/huggingface/daily-papers.js +10 -7
- package/lib/v2/huxiu/util.js +1 -1
- package/lib/v2/indiansinkuwait/radar.js +1 -1
- package/lib/v2/indienova/article.js +24 -0
- package/lib/v2/indienova/column.js +20 -0
- package/lib/v2/indienova/gamedb.js +55 -0
- package/lib/v2/indienova/maintainer.js +6 -0
- package/lib/v2/indienova/radar.js +37 -0
- package/lib/v2/indienova/router.js +6 -0
- package/lib/v2/indienova/usergames.js +42 -0
- package/lib/v2/indienova/utils.js +43 -0
- package/lib/v2/instagram/common-utils.js +1 -1
- package/lib/v2/iresearch/weekly.js +2 -2
- package/lib/v2/javlibrary/utils.js +1 -1
- package/lib/v2/jewishmuseum/radar.js +1 -1
- package/lib/v2/jiemian/lists.js +1 -1
- package/lib/v2/jike/topic.js +3 -0
- package/lib/v2/jinse/catalogue.js +101 -0
- package/lib/v2/jinse/lives.js +87 -0
- package/lib/v2/jinse/maintainer.js +5 -0
- package/lib/v2/jinse/radar.js +187 -0
- package/lib/v2/jinse/router.js +5 -0
- package/lib/v2/jinse/templates/description.art +34 -0
- package/lib/v2/jinse/timeline.js +96 -0
- package/lib/v2/jjwxc/author.js +68 -0
- package/lib/v2/jjwxc/book.js +106 -0
- package/lib/v2/jjwxc/maintainer.js +4 -0
- package/lib/v2/jjwxc/radar.js +29 -0
- package/lib/v2/jjwxc/router.js +4 -0
- package/lib/v2/jjwxc/templates/author.art +28 -0
- package/lib/v2/jjwxc/templates/book.art +44 -0
- package/lib/v2/kcna/news.js +2 -3
- package/lib/v2/keepass/maintainer.js +3 -0
- package/lib/v2/keepass/news.js +46 -0
- package/lib/v2/keepass/radar.js +13 -0
- package/lib/v2/keepass/router.js +3 -0
- package/lib/v2/konghq/blog-posts.js +52 -0
- package/lib/v2/konghq/maintainer.js +3 -0
- package/lib/v2/konghq/radar.js +13 -0
- package/lib/v2/konghq/router.js +3 -0
- package/lib/v2/kuwaitlocal/radar.js +2 -2
- package/lib/v2/laimanhua/index.js +41 -0
- package/lib/v2/laimanhua/maintainer.js +3 -0
- package/lib/v2/laimanhua/radar.js +13 -0
- package/lib/v2/laimanhua/router.js +3 -0
- package/lib/v2/layoffs/radar.js +1 -1
- package/lib/v2/linkedin/radar.js +1 -1
- package/lib/v2/lofter/tag.js +69 -34
- package/lib/v2/lofter/user.js +1 -1
- package/lib/v2/lxixsxa/radar.js +4 -4
- package/lib/v2/manhuagui/subscribe.js +1 -1
- package/lib/v2/mastodon/utils.js +1 -1
- package/lib/v2/metacritic/index.js +1 -1
- package/lib/v2/metmuseum/radar.js +1 -1
- package/lib/v2/mihoyo/bbs/cache.js +40 -0
- package/lib/v2/mihoyo/bbs/follow-list.js +50 -0
- package/lib/v2/mihoyo/bbs/img-ranking.js +2 -27
- package/lib/v2/mihoyo/bbs/official.js +3 -20
- package/lib/v2/mihoyo/bbs/timeline.js +41 -0
- package/lib/v2/mihoyo/bbs/user-post.js +32 -0
- package/lib/v2/mihoyo/bbs/utils.js +34 -0
- package/lib/v2/mihoyo/maintainer.js +3 -0
- package/lib/v2/mihoyo/radar.js +61 -32
- package/lib/v2/mihoyo/router.js +3 -0
- package/lib/v2/modrinth/api.d.ts +101 -0
- package/lib/v2/modrinth/maintainer.js +3 -0
- package/lib/v2/modrinth/radar.js +13 -0
- package/lib/v2/modrinth/router.js +3 -0
- package/lib/v2/modrinth/templates/version.art +8 -0
- package/lib/v2/modrinth/versions.js +75 -0
- package/lib/v2/mrm/index.js +42 -0
- package/lib/v2/mrm/maintainer.js +3 -0
- package/lib/v2/mrm/radar.js +13 -0
- package/lib/v2/mrm/router.js +3 -0
- package/lib/v2/nautil/radar.js +1 -1
- package/lib/v2/nber/radar.js +2 -2
- package/lib/v2/newmuseum/radar.js +1 -1
- package/lib/v2/news/maintainer.js +1 -1
- package/lib/v2/news/radar.js +2 -2
- package/lib/v2/news/router.js +2 -1
- package/lib/v2/news/templates/description.art +21 -0
- package/lib/v2/news/xhsxw.js +81 -0
- package/lib/v2/nju/radar.js +4 -4
- package/lib/v2/njust/cwc.js +1 -1
- package/lib/v2/njust/dgxg.js +1 -1
- package/lib/v2/njust/eo.js +1 -1
- package/lib/v2/njust/eoe.js +1 -1
- package/lib/v2/njust/jwc.js +1 -1
- package/lib/v2/notion/database.js +1 -1
- package/lib/v2/onehu/common.js +28 -0
- package/lib/v2/onehu/maintainer.js +3 -0
- package/lib/v2/onehu/radar.js +11 -0
- package/lib/v2/onehu/router.js +3 -0
- package/lib/v2/openai/radar.js +3 -3
- package/lib/v2/parliament/maintainer.js +3 -0
- package/lib/v2/parliament/radar.js +22 -0
- package/lib/v2/parliament/router.js +3 -0
- package/lib/v2/parliament/section77.js +161 -0
- package/lib/v2/pianyuan/search.js +1 -1
- package/lib/v2/pianyuan/utils.js +2 -2
- package/lib/v2/picnob/radar.js +1 -1
- package/lib/v2/pikabu/radar.js +3 -3
- package/lib/v2/pixabay/radar.js +1 -1
- package/lib/v2/pixiv/bookmarks.js +2 -2
- package/lib/v2/pixiv/illustfollow.js +2 -2
- package/lib/v2/pixiv/ranking.js +2 -2
- package/lib/v2/pixiv/search.js +2 -2
- package/lib/v2/pixiv/user.js +2 -2
- package/lib/v2/playpcesor/maintainer.js +3 -0
- package/lib/v2/playpcesor/radar.js +13 -0
- package/lib/v2/playpcesor/router.js +3 -0
- package/lib/v2/playpcesor/rss.js +32 -0
- package/lib/v2/pwc/maintainer.js +3 -0
- package/lib/v2/pwc/radar.js +13 -0
- package/lib/v2/pwc/router.js +3 -0
- package/lib/v2/pwc/sustainability.js +58 -0
- package/lib/v2/qdu/houqin.js +63 -0
- package/lib/v2/qdu/maintainer.js +1 -0
- package/lib/v2/qdu/radar.js +8 -0
- package/lib/v2/qdu/router.js +1 -0
- package/lib/v2/rarehistoricalphotos/radar.js +1 -1
- package/lib/v2/rattibha/radar.js +1 -1
- package/lib/v2/reactnewsletter/radar.js +1 -1
- package/lib/v2/scmp/index.js +2 -31
- package/lib/v2/scmp/maintainer.js +2 -0
- package/lib/v2/scmp/radar.js +7 -1
- package/lib/v2/scmp/router.js +2 -0
- package/lib/v2/scmp/topic.js +66 -0
- package/lib/v2/scmp/utils.js +32 -0
- package/lib/v2/secrss/author.js +18 -7
- package/lib/v2/secrss/category.js +19 -8
- package/lib/v2/secrss/maintainer.js +2 -2
- package/lib/v2/seekingalpha/radar.js +1 -1
- package/lib/v2/sehuatang/user.js +1 -1
- package/lib/v2/shoac/maintainer.js +3 -0
- package/lib/v2/shoac/radar.js +13 -0
- package/lib/v2/shoac/recent-show.js +72 -0
- package/lib/v2/shoac/router.js +3 -0
- package/lib/v2/shoac/templates/detail.art +25 -0
- package/lib/v2/smashingmagazine/radar.js +2 -2
- package/lib/v2/spotify/top.js +1 -1
- package/lib/v2/spotify/utils.js +2 -2
- package/lib/v2/sspai/author.js +1 -1
- package/lib/v2/stockedge/radar.js +1 -1
- package/lib/v2/stratechery/radar.js +1 -1
- package/lib/v2/tass/maintainer.js +3 -0
- package/lib/v2/tass/news.js +58 -0
- package/lib/v2/tass/radar.js +13 -0
- package/lib/v2/tass/router.js +3 -0
- package/lib/v2/techpowerup/radar.js +2 -2
- package/lib/v2/telegram/channel.js +1 -1
- package/lib/v2/telegram/stickerpack.js +1 -1
- package/lib/v2/tencent/news/author.js +34 -26
- package/lib/v2/tencent/templates/news/image.art +1 -1
- package/lib/v2/test/index.js +11 -0
- package/lib/v2/thehindu/radar.js +1 -1
- package/lib/v2/thepaper/utils.js +1 -1
- package/lib/v2/threads/radar.js +1 -1
- package/lib/v2/tiktok/radar.js +1 -1
- package/lib/v2/tradingview/pine.js +54 -0
- package/lib/v2/tradingview/radar.js +6 -0
- package/lib/v2/tradingview/router.js +1 -0
- package/lib/v2/transcriptforest/index.js +116 -0
- package/lib/v2/transcriptforest/maintainer.js +3 -0
- package/lib/v2/transcriptforest/radar.js +307 -0
- package/lib/v2/transcriptforest/router.js +3 -0
- package/lib/v2/transcriptforest/templates/description.art +23 -0
- package/lib/v2/twitter/likes.js +1 -1
- package/lib/v2/twitter/list.js +1 -1
- package/lib/v2/twitter/trends.js +1 -1
- package/lib/v2/twitter/utils.js +13 -4
- package/lib/v2/twitter/web-api/constants.js +6 -0
- package/lib/v2/twitter/web-api/login.js +183 -0
- package/lib/v2/twitter/web-api/media.js +2 -0
- package/lib/v2/twitter/web-api/search.js +2 -0
- package/lib/v2/twitter/web-api/token.js +44 -0
- package/lib/v2/twitter/web-api/tweet.js +2 -0
- package/lib/v2/twitter/web-api/twitter-api.js +13 -17
- package/lib/v2/twitter/web-api/user.js +2 -0
- package/lib/v2/unusualwhales/radar.js +1 -1
- package/lib/v2/urbandictionary/radar.js +1 -1
- package/lib/v2/ustc/eeis.js +1 -1
- package/lib/v2/ustc/gs.js +1 -1
- package/lib/v2/ustc/sist.js +1 -1
- package/lib/v2/verfghbw/radar.js +1 -1
- package/lib/v2/weibo/friends.js +122 -0
- package/lib/v2/weibo/group.js +1 -1
- package/lib/v2/weibo/maintainer.js +1 -0
- package/lib/v2/weibo/radar.js +7 -1
- package/lib/v2/weibo/router.js +1 -0
- package/lib/v2/weibo/user.js +3 -1
- package/lib/v2/weibo/utils.js +4 -1
- package/lib/v2/wmc-bj/maintainer.js +3 -0
- package/lib/v2/wmc-bj/publish.js +58 -0
- package/lib/v2/wmc-bj/radar.js +17 -0
- package/lib/v2/wmc-bj/router.js +3 -0
- package/lib/v2/wmc-bj/templates/description.art +5 -0
- package/lib/v2/xueqiu/hots.js +2 -1
- package/lib/v2/xueqiu/router.js +1 -1
- package/lib/v2/xueqiu/stock-comments.js +2 -2
- package/lib/v2/xueqiu/stock-info.js +2 -1
- package/lib/v2/xueqiu/user.js +2 -1
- package/lib/v2/yoasobi-music/radar.js +4 -4
- package/lib/v2/youtube/custom.js +1 -1
- package/lib/v2/youtube/playlist.js +1 -1
- package/lib/v2/youtube/subscriptions.js +1 -1
- package/lib/v2/zhihu/maintainer.js +1 -1
- package/lib/v2/zhihu/router.js +1 -1
- package/lib/v2/zhihu/topic.js +93 -50
- package/lib/v2/zhihu/utils.js +0 -1
- package/package.json +26 -24
- package/lib/routes/4gamers/category.js +0 -20
- package/lib/routes/4gamers/tag.js +0 -20
- package/lib/routes/4gamers/topic.js +0 -20
- package/lib/routes/cs/news.js +0 -69
- package/lib/routes/indienova/article.js +0 -53
- package/lib/routes/jinse/catalogue.js +0 -20
- package/lib/routes/jinse/lives.js +0 -20
- package/lib/routes/jinse/timeline.js +0 -21
- package/lib/v2/cas/genetics/xshd.js +0 -29
- package/lib/v2/news/whxw.js +0 -68
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const iconv = require('iconv-lite');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
6
|
+
const { art } = require('@/utils/render');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'https://www.56kog.com';
|
|
10
|
+
|
|
11
|
+
const fetchItems = async (limit, currentUrl, tryGet) => {
|
|
12
|
+
const { data: response } = await got(currentUrl, {
|
|
13
|
+
responseType: 'buffer',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(iconv.decode(response, 'gbk'));
|
|
17
|
+
|
|
18
|
+
let items = $('p.line')
|
|
19
|
+
.toArray()
|
|
20
|
+
.map((item) => {
|
|
21
|
+
item = $(item);
|
|
22
|
+
|
|
23
|
+
const a = item.find('a');
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
title: a.text(),
|
|
27
|
+
link: new URL(a.prop('href'), rootUrl).href,
|
|
28
|
+
author: item.find('span').last().text(),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
items = await Promise.all(
|
|
33
|
+
items.map((item) =>
|
|
34
|
+
tryGet(item.link, async () => {
|
|
35
|
+
try {
|
|
36
|
+
const { data: detailResponse } = await got(item.link, {
|
|
37
|
+
responseType: 'buffer',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const content = cheerio.load(iconv.decode(detailResponse, 'gbk'));
|
|
41
|
+
|
|
42
|
+
const details = content('div.mohe-content p')
|
|
43
|
+
.toArray()
|
|
44
|
+
.map((detail) => {
|
|
45
|
+
detail = content(detail);
|
|
46
|
+
const as = detail.find('a');
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
label: detail.find('span.c-l-depths').text().split(/:/)[0],
|
|
50
|
+
value:
|
|
51
|
+
as.length === 0
|
|
52
|
+
? content(
|
|
53
|
+
detail
|
|
54
|
+
.contents()
|
|
55
|
+
.toArray()
|
|
56
|
+
.find((c) => c.nodeType === 3)
|
|
57
|
+
)
|
|
58
|
+
.text()
|
|
59
|
+
.trim()
|
|
60
|
+
: {
|
|
61
|
+
href: new URL(as.first().prop('href'), rootUrl).href,
|
|
62
|
+
text: as.first().text().trim(),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const pubDate = details.find((detail) => detail.label === '更新').value;
|
|
68
|
+
|
|
69
|
+
item.title = content('h1').contents().first().text();
|
|
70
|
+
item.description = art(path.join(__dirname, 'templates/description.art'), {
|
|
71
|
+
images: [
|
|
72
|
+
{
|
|
73
|
+
src: new URL(content('a.mohe-imgs img').prop('src'), rootUrl).href,
|
|
74
|
+
alt: item.title,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
details,
|
|
78
|
+
});
|
|
79
|
+
item.author = details.find((detail) => detail.label === '作者').value;
|
|
80
|
+
item.category = [details.find((detail) => detail.label === '状态').value, details.find((detail) => detail.label === '类型').value.text].filter(Boolean);
|
|
81
|
+
item.guid = `56kog-${item.link.match(/\/(\d+)\.html$/)[1]}#${pubDate}`;
|
|
82
|
+
item.pubDate = timezone(parseDate(pubDate), +8);
|
|
83
|
+
} catch {
|
|
84
|
+
// no-empty
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return item;
|
|
88
|
+
})
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const icon = new URL('favicon.ico', rootUrl).href;
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
item: items.filter((item) => item.description).slice(0, limit),
|
|
96
|
+
title: $('title').text(),
|
|
97
|
+
link: currentUrl,
|
|
98
|
+
description: $('meta[name="description"]').prop('content'),
|
|
99
|
+
language: $('html').prop('lang'),
|
|
100
|
+
icon,
|
|
101
|
+
logo: icon,
|
|
102
|
+
subtitle: $('meta[name="keywords"]').prop('content'),
|
|
103
|
+
author: $('div.uni_footer a').text(),
|
|
104
|
+
allowEmpty: true,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
module.exports = {
|
|
109
|
+
rootUrl,
|
|
110
|
+
fetchItems,
|
|
111
|
+
};
|
package/lib/v2/591/list.js
CHANGED
package/lib/v2/acfun/article.js
CHANGED
|
@@ -35,13 +35,13 @@ const timeRangeEnum = new Set(['all', 'oneDay', 'threeDay', 'oneWeek', 'oneMonth
|
|
|
35
35
|
module.exports = async (ctx) => {
|
|
36
36
|
const { categoryId, sortType = 'createTime', timeRange = 'all' } = ctx.params;
|
|
37
37
|
if (!categoryMap[categoryId]) {
|
|
38
|
-
throw `Invalid category Id: ${categoryId}
|
|
38
|
+
throw new Error(`Invalid category Id: ${categoryId}`);
|
|
39
39
|
}
|
|
40
40
|
if (!sortTypeEnum.has(sortType)) {
|
|
41
|
-
throw `Invalid sort type: ${sortType}
|
|
41
|
+
throw new Error(`Invalid sort type: ${sortType}`);
|
|
42
42
|
}
|
|
43
43
|
if (!timeRangeEnum.has(timeRange)) {
|
|
44
|
-
throw `Invalid time range: ${timeRange}
|
|
44
|
+
throw new Error(`Invalid time range: ${timeRange}`);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const url = `${baseUrl}/v/list${categoryId}/index.htm`;
|
|
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|
|
21
21
|
.toArray()
|
|
22
22
|
.filter((h) => (type ? $(h).text() === type : true));
|
|
23
23
|
if (!targetList) {
|
|
24
|
-
throw `Not found ${type} in ${id}: ${currentUrl}
|
|
24
|
+
throw new Error(`Not found ${type} in ${id}: ${currentUrl}`);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
for (const l of targetList) {
|
|
@@ -4,13 +4,13 @@ module.exports = {
|
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: 'Articles',
|
|
7
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/programming#a-list-apart',
|
|
8
8
|
source: ['/articles/'],
|
|
9
9
|
target: '/alistapart',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
title: 'Topics',
|
|
13
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/programming#a-list-apart',
|
|
14
14
|
source: ['/blog/topic/:topic'],
|
|
15
15
|
target: '/alistapart/:topic',
|
|
16
16
|
},
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const iconv = require('iconv-lite');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const { category = 'xxkd' } = ctx.params;
|
|
9
|
+
const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
|
|
10
|
+
|
|
11
|
+
const rootUrl = 'http://www.auto-stats.org.cn';
|
|
12
|
+
const currentUrl = new URL(`${category}.asp`, rootUrl).href;
|
|
13
|
+
|
|
14
|
+
const { data: response } = await got(currentUrl, {
|
|
15
|
+
responseType: 'buffer',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const $ = cheerio.load(iconv.decode(response, 'gbk'));
|
|
19
|
+
|
|
20
|
+
let items = $('a.dnews font')
|
|
21
|
+
.slice(0, limit)
|
|
22
|
+
.toArray()
|
|
23
|
+
.map((item) => {
|
|
24
|
+
item = $(item);
|
|
25
|
+
|
|
26
|
+
const title = item.text();
|
|
27
|
+
const pubDate = title.match(/(\d{4}(?:\/\d{1,2}){2}\s\d{1,2}(?::\d{2}){2})/)?.[1] ?? undefined;
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
title: title.replace(/●/, '').split(/(\d+/)[0],
|
|
31
|
+
link: new URL(item.parent().prop('href'), rootUrl).href,
|
|
32
|
+
pubDate: timezone(parseDate(pubDate, 'YYYY/M/D H:mm:ss'), +8),
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
items = await Promise.all(
|
|
37
|
+
items.map((item) =>
|
|
38
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
39
|
+
const { data: detailResponse } = await got(item.link, {
|
|
40
|
+
responseType: 'buffer',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const content = cheerio.load(iconv.decode(detailResponse, 'gbk'));
|
|
44
|
+
|
|
45
|
+
item.description = content('table tbody tr td.dd').last().html();
|
|
46
|
+
|
|
47
|
+
return item;
|
|
48
|
+
})
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const subtitle = $('title').text().split(/——/).pop();
|
|
53
|
+
const image = new URL('images/logo.jpg', rootUrl).href;
|
|
54
|
+
|
|
55
|
+
ctx.state.data = {
|
|
56
|
+
item: items,
|
|
57
|
+
title: $('title').text(),
|
|
58
|
+
link: currentUrl,
|
|
59
|
+
description: subtitle,
|
|
60
|
+
language: 'zh',
|
|
61
|
+
image,
|
|
62
|
+
subtitle,
|
|
63
|
+
allowEmpty: true,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'auto-stats.org.cn': {
|
|
3
|
+
_name: '中国汽车工业协会统计信息网',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '分类',
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
|
|
8
|
+
source: ['/:category'],
|
|
9
|
+
target: (params) => {
|
|
10
|
+
const category = params.category;
|
|
11
|
+
|
|
12
|
+
return `/auto-stats${category ? `/${category.replace(/\.asp$/, '')}` : ''}`;
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
title: '信息快递',
|
|
17
|
+
docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
|
|
18
|
+
source: ['/xxkd.asp'],
|
|
19
|
+
target: '/auto-stats/xxkd',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: '工作动态',
|
|
23
|
+
docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
|
|
24
|
+
source: ['/gzdt.asp'],
|
|
25
|
+
target: '/auto-stats/gzdt',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '专题分析',
|
|
29
|
+
docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
|
|
30
|
+
source: ['/ztfx.asp'],
|
|
31
|
+
target: '/auto-stats/ztfx',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
};
|
package/lib/v2/bsky/posts.js
CHANGED
|
@@ -26,7 +26,7 @@ module.exports = async (ctx) => {
|
|
|
26
26
|
|
|
27
27
|
ctx.state.data = {
|
|
28
28
|
title: `${profile.displayName} (@${profile.handle}) — Bluesky`,
|
|
29
|
-
description: profile.description
|
|
29
|
+
description: profile.description?.replaceAll('\n', ' '),
|
|
30
30
|
link: `https://bsky.app/profile/${profile.handle}`,
|
|
31
31
|
image: profile.banner,
|
|
32
32
|
icon: profile.avatar,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
2
|
+
const got = require('@/utils/got');
|
|
3
|
+
const cheerio = require('cheerio');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const url = 'https://bulianglin.com/';
|
|
7
|
+
const response = await got({ method: 'get', url });
|
|
8
|
+
const $ = cheerio.load(response.data);
|
|
9
|
+
|
|
10
|
+
const list = $('div.single-post')
|
|
11
|
+
.map((i, e) => {
|
|
12
|
+
const element = $(e);
|
|
13
|
+
const title = element.find('h2 > a').text();
|
|
14
|
+
const link = element.find('h2 > a').attr('href');
|
|
15
|
+
const description = element.find('p.summary').text();
|
|
16
|
+
const dateraw = element.find('div.text-muted').find('li').eq(1).text();
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
link,
|
|
22
|
+
pubDate: parseDate(dateraw, 'YYYY 年 MM 月 DD 日'),
|
|
23
|
+
};
|
|
24
|
+
})
|
|
25
|
+
.get();
|
|
26
|
+
|
|
27
|
+
ctx.state.data = {
|
|
28
|
+
title: '不良林',
|
|
29
|
+
link: url,
|
|
30
|
+
item: list,
|
|
31
|
+
};
|
|
32
|
+
};
|
package/lib/v2/bytes/radar.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = {
|
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: 'BYTES - Your weekly dose of JS',
|
|
7
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/programming#ui-dev-bytes',
|
|
8
8
|
source: ['/archives', '/'],
|
|
9
9
|
target: '/bytes',
|
|
10
10
|
},
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const { category = '1' } = ctx.params;
|
|
7
|
+
const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'http://www.caam.org.cn';
|
|
10
|
+
const currentUrl = new URL(`chn/1/cate_${category}/list_1.html`, rootUrl).href;
|
|
11
|
+
|
|
12
|
+
const { data: response } = await got(currentUrl);
|
|
13
|
+
|
|
14
|
+
const $ = cheerio.load(response);
|
|
15
|
+
|
|
16
|
+
let items = $('span.cont')
|
|
17
|
+
.slice(0, limit)
|
|
18
|
+
.toArray()
|
|
19
|
+
.map((item) => {
|
|
20
|
+
item = $(item);
|
|
21
|
+
|
|
22
|
+
const a = item.parent();
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
title: item.text(),
|
|
26
|
+
link: new URL(a.prop('href'), currentUrl).href,
|
|
27
|
+
pubDate: parseDate(a.find('span.time').text(), '[YYYY.MM.DD]'),
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
items = await Promise.all(
|
|
32
|
+
items.map((item) =>
|
|
33
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
34
|
+
const { data: detailResponse } = await got(item.link);
|
|
35
|
+
|
|
36
|
+
const content = cheerio.load(detailResponse);
|
|
37
|
+
|
|
38
|
+
const infoEls = content('div.fourTop em');
|
|
39
|
+
|
|
40
|
+
item.title = content('div.fourTop h2').text();
|
|
41
|
+
item.description = content('div.fourBox').html();
|
|
42
|
+
item.author = infoEls.length <= 1 ? undefined : content('div.fourTop em').last().text();
|
|
43
|
+
item.pubDate = parseDate(infoEls.first().text());
|
|
44
|
+
|
|
45
|
+
return item;
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const author = $('div.footer a').first().text();
|
|
51
|
+
const subtitle = $('div.topMeuns ul li a').last().text();
|
|
52
|
+
const image = new URL('images/header-back-7.png', rootUrl).href;
|
|
53
|
+
|
|
54
|
+
ctx.state.data = {
|
|
55
|
+
item: items,
|
|
56
|
+
title: `${author} - ${subtitle}`,
|
|
57
|
+
link: currentUrl,
|
|
58
|
+
description: $('meta[property="og:description"]').prop('content'),
|
|
59
|
+
language: $('html').prop('lang'),
|
|
60
|
+
image,
|
|
61
|
+
subtitle,
|
|
62
|
+
author,
|
|
63
|
+
};
|
|
64
|
+
};
|