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,83 @@
|
|
|
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
|
+
const decodeBufferByCharset = (buffer) => {
|
|
8
|
+
const isGBK = /charset="?'?gb/i.test(buffer.toString());
|
|
9
|
+
const encoding = isGBK ? 'gbk' : 'utf-8';
|
|
10
|
+
|
|
11
|
+
return iconv.decode(buffer, encoding);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = async (ctx) => {
|
|
15
|
+
const { category = 'xwzx' } = ctx.params;
|
|
16
|
+
const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
|
|
17
|
+
|
|
18
|
+
const rootUrl = 'https://www.cs.com.cn';
|
|
19
|
+
const currentUrl = new URL(category.endsWith('/') ? category : `${category}/`, rootUrl).href;
|
|
20
|
+
|
|
21
|
+
const { data: response } = await got(currentUrl, {
|
|
22
|
+
responseType: 'buffer',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const $ = cheerio.load(decodeBufferByCharset(response));
|
|
26
|
+
|
|
27
|
+
let items = $('ul.ch_type3_list li a')
|
|
28
|
+
.slice(0, limit)
|
|
29
|
+
.toArray()
|
|
30
|
+
.map((item) => {
|
|
31
|
+
item = $(item);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
title: item.find('h3').text().trim(),
|
|
35
|
+
link: new URL(item.prop('href'), currentUrl).href,
|
|
36
|
+
pubDate: timezone(parseDate(item.find('em').text()), +8),
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
items = await Promise.all(
|
|
41
|
+
items.map((item) =>
|
|
42
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
43
|
+
try {
|
|
44
|
+
const { data: detailResponse } = await got(item.link, {
|
|
45
|
+
responseType: 'buffer',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const content = cheerio.load(decodeBufferByCharset(detailResponse));
|
|
49
|
+
|
|
50
|
+
item.title = content('article.cont_article header h1').text().trim();
|
|
51
|
+
item.description = content('article.cont_article section').html();
|
|
52
|
+
item.author = content('div.artc_info em').text().trim();
|
|
53
|
+
item.category = content('div.artc_route div a')
|
|
54
|
+
.slice(1)
|
|
55
|
+
.toArray()
|
|
56
|
+
.map((c) => content(c).prop('title') ?? content(c).text());
|
|
57
|
+
item.pubDate = timezone(parseDate(content('.time').prop('datetime')), +8);
|
|
58
|
+
} catch {
|
|
59
|
+
// no-empty
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return item;
|
|
63
|
+
})
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const title = $('title').text();
|
|
68
|
+
const image = new URL($('div.logo_cs a img').prop('src'), currentUrl).href;
|
|
69
|
+
const icon = new URL('favicon.ico', rootUrl).href;
|
|
70
|
+
|
|
71
|
+
ctx.state.data = {
|
|
72
|
+
item: items,
|
|
73
|
+
title,
|
|
74
|
+
link: currentUrl,
|
|
75
|
+
description: $('meta[name="Description"]').prop('content'),
|
|
76
|
+
language: $('html').prop('lang'),
|
|
77
|
+
image,
|
|
78
|
+
icon,
|
|
79
|
+
logo: icon,
|
|
80
|
+
subtitle: $('meta[name="Keywords"]').prop('content'),
|
|
81
|
+
author: title.split('-').pop().trim(),
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'cs.com.cn': {
|
|
3
|
+
_name: '中证网',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '要闻',
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
8
|
+
source: ['/xwzx/'],
|
|
9
|
+
target: '/cs/xwzx',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '公司',
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
14
|
+
source: ['/ssgs/'],
|
|
15
|
+
target: '/cs/ssgs',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '市场',
|
|
19
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
20
|
+
source: ['/gppd/'],
|
|
21
|
+
target: '/cs/gppd',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: '基金',
|
|
25
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
26
|
+
source: ['/tzjj/'],
|
|
27
|
+
target: '/cs/tzjj',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: '科创',
|
|
31
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
32
|
+
source: ['/5g/'],
|
|
33
|
+
target: '/cs/5g',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: '产经',
|
|
37
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
38
|
+
source: ['/cj2020/'],
|
|
39
|
+
target: '/cs/cj2020',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: '期货',
|
|
43
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
44
|
+
source: ['/zzqh2020/'],
|
|
45
|
+
target: '/cs/zzqh2020',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: '海外',
|
|
49
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
50
|
+
source: ['/hw2020/'],
|
|
51
|
+
target: '/cs/hw2020',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: '财经要闻',
|
|
55
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
56
|
+
source: ['/xwzx/hg/'],
|
|
57
|
+
target: '/cs/xwzx/hg',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: '观点评论',
|
|
61
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
62
|
+
source: ['/xwzx/jr/'],
|
|
63
|
+
target: '/cs/xwzx/jr',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: '民生消费',
|
|
67
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
68
|
+
source: ['/xwzx/msxf/'],
|
|
69
|
+
target: '/cs/xwzx/msxf',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: '公司要闻',
|
|
73
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
74
|
+
source: ['/ssgs/gsxw/'],
|
|
75
|
+
target: '/cs/ssgs/gsxw',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: '公司深度',
|
|
79
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
80
|
+
source: ['/ssgs/gssd/'],
|
|
81
|
+
target: '/cs/ssgs/gssd',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: '公司巡礼',
|
|
85
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
86
|
+
source: ['/ssgs/gsxl/'],
|
|
87
|
+
target: '/cs/ssgs/gsxl',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'A股市场',
|
|
91
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
92
|
+
source: ['/gppd/gsyj/'],
|
|
93
|
+
target: '/cs/gppd/gsyj',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: '港股资讯',
|
|
97
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
98
|
+
source: ['/gppd/ggzx/'],
|
|
99
|
+
target: '/cs/gppd/ggzx',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: '债市研究',
|
|
103
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
104
|
+
source: ['/gppd/zqxw/'],
|
|
105
|
+
target: '/cs/gppd/zqxw',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: '海外报道',
|
|
109
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
110
|
+
source: ['/gppd/hwbd/'],
|
|
111
|
+
target: '/cs/gppd/hwbd',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '期货报道',
|
|
115
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
116
|
+
source: ['/gppd/qhbd/'],
|
|
117
|
+
target: '/cs/gppd/qhbd',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: '基金动态',
|
|
121
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
122
|
+
source: ['/tzjj/jjdt/'],
|
|
123
|
+
target: '/cs/tzjj/jjdt',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
title: '基金视点',
|
|
127
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
128
|
+
source: ['/tzjj/jjks/'],
|
|
129
|
+
target: '/cs/tzjj/jjks',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: '基金持仓',
|
|
133
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
134
|
+
source: ['/tzjj/jjcs/'],
|
|
135
|
+
target: '/cs/tzjj/jjcs',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: '私募基金',
|
|
139
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
140
|
+
source: ['/tzjj/smjj/'],
|
|
141
|
+
target: '/cs/tzjj/smjj',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: '基民学苑',
|
|
145
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
146
|
+
source: ['/tzjj/tjdh/'],
|
|
147
|
+
target: '/cs/tzjj/tjdh',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: '券商',
|
|
151
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
152
|
+
source: ['/qs/'],
|
|
153
|
+
target: '/cs/qs',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: '银行',
|
|
157
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
158
|
+
source: ['/yh/'],
|
|
159
|
+
target: '/cs/yh',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
title: '保险',
|
|
163
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
164
|
+
source: ['/bx/'],
|
|
165
|
+
target: '/cs/bx',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
title: '中证快讯 7x24',
|
|
169
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
170
|
+
source: ['/sylm/jsbd/'],
|
|
171
|
+
target: '/cs/sylm/jsbd',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: 'IPO鉴真',
|
|
175
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
176
|
+
source: ['/yc/ipojz/'],
|
|
177
|
+
target: '/cs/yc/ipojz',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
title: '公司能见度',
|
|
181
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-lan-mu',
|
|
182
|
+
source: ['/yc/gsnjd/'],
|
|
183
|
+
target: '/cs/yc/gsnjd',
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
video: [
|
|
187
|
+
{
|
|
188
|
+
title: '中证视频',
|
|
189
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
190
|
+
source: ['list.html'],
|
|
191
|
+
target: (_, url) => {
|
|
192
|
+
const category = url.searchParams.get('title') || url.searchParams.get('id');
|
|
193
|
+
|
|
194
|
+
return `/cs/video${category ? `/${category}` : ''}`;
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
title: '今日聚焦',
|
|
199
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
200
|
+
source: ['list.html'],
|
|
201
|
+
target: '/cs/video/今日聚焦',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
title: '传闻求证',
|
|
205
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
206
|
+
source: ['list.html'],
|
|
207
|
+
target: '/cs/video/传闻求证',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: '高端访谈',
|
|
211
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
212
|
+
source: ['list.html'],
|
|
213
|
+
target: '/cs/video/高端访谈',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
title: '投教课堂',
|
|
217
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
218
|
+
source: ['list.html'],
|
|
219
|
+
target: '/cs/video/投教课堂',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: '直播汇',
|
|
223
|
+
docs: 'https://docs.rsshub.app/routes/finance#zhong-zheng-wang-zhong-zheng-shi-pin',
|
|
224
|
+
source: ['list.html'],
|
|
225
|
+
target: '/cs/video/直播汇',
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const toZzkx = (ctx) => {
|
|
2
|
+
// https://www.cs.com.cn/sylm/jsbd/
|
|
3
|
+
|
|
4
|
+
const redirectTo = '/cs/sylm/jsbd';
|
|
5
|
+
ctx.redirect(redirectTo);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
module.exports = (router) => {
|
|
9
|
+
router.get('/news/zzkx', toZzkx);
|
|
10
|
+
router.get('/zzkx', toZzkx);
|
|
11
|
+
router.get('/video/:category?', require('./video'));
|
|
12
|
+
router.get('/:category*', require('./'));
|
|
13
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const { category = '今日聚焦' } = ctx.params;
|
|
8
|
+
const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 50;
|
|
9
|
+
|
|
10
|
+
const rootUrl = 'https://video.cs.com.cn';
|
|
11
|
+
const apiCategoryUrl = new URL('web/api/getCategory', rootUrl).href;
|
|
12
|
+
const apiUrl = new URL('web/api/toSecondPage', rootUrl).href;
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
data: { data: categoryResponse },
|
|
16
|
+
} = await got.post(apiCategoryUrl);
|
|
17
|
+
|
|
18
|
+
const categories = categoryResponse.map((c) => ({
|
|
19
|
+
id: c.id,
|
|
20
|
+
title: c.categoryTitle,
|
|
21
|
+
image: c.categoryImg,
|
|
22
|
+
sortType: c.categorySortType,
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
const selected = categories.find((c) => c.title === category || c.id === category);
|
|
26
|
+
|
|
27
|
+
const currentUrl = new URL(`list.html?title=${selected.title}&id=${selected.id}`, rootUrl).href;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
data: { records: response },
|
|
31
|
+
} = await got.post(apiUrl, {
|
|
32
|
+
json: {
|
|
33
|
+
categorySortType: selected.sortType,
|
|
34
|
+
id: selected.id,
|
|
35
|
+
pageNum: 1,
|
|
36
|
+
pageSize: limit,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const items = response.slice(0, limit).map((item) => ({
|
|
41
|
+
title: item.contentTitle,
|
|
42
|
+
link: new URL(item.contentUrl, rootUrl).href,
|
|
43
|
+
description: item.contentDetails,
|
|
44
|
+
author: item.contentSource,
|
|
45
|
+
pubDate: timezone(parseDate(item.contentDatetime), +8),
|
|
46
|
+
updated: timezone(parseDate(item.updateDate), +8),
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
const { data: currentResponse } = await got(currentUrl);
|
|
50
|
+
|
|
51
|
+
const $ = cheerio.load(currentResponse);
|
|
52
|
+
|
|
53
|
+
const title = $('title').text();
|
|
54
|
+
const image = selected.image;
|
|
55
|
+
const icon = new URL($('link[rel="icon"]').prop('href'), rootUrl).href;
|
|
56
|
+
|
|
57
|
+
ctx.state.data = {
|
|
58
|
+
item: items,
|
|
59
|
+
title: `${title} | ${selected.title}`,
|
|
60
|
+
link: currentUrl,
|
|
61
|
+
description: $('meta[name="Description"]').prop('content'),
|
|
62
|
+
language: $('html').prop('lang'),
|
|
63
|
+
image,
|
|
64
|
+
icon,
|
|
65
|
+
logo: icon,
|
|
66
|
+
subtitle: $('meta[name="Keywords"]').prop('content'),
|
|
67
|
+
author: title.split('-').pop().trim(),
|
|
68
|
+
allowEmpty: true,
|
|
69
|
+
};
|
|
70
|
+
};
|
package/lib/v2/daily/radar.js
CHANGED
|
@@ -4,19 +4,19 @@ module.exports = {
|
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: 'Most Discussed',
|
|
7
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/social-media#daily.dev',
|
|
8
8
|
source: ['/discussed'],
|
|
9
9
|
target: '/daily/discussed',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
title: 'Most Upvoted',
|
|
13
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/social-media#daily.dev',
|
|
14
14
|
source: ['/upvoted'],
|
|
15
15
|
target: '/daily/upvoted',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
title: 'Popular',
|
|
19
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
19
|
+
docs: 'https://docs.rsshub.app/routes/social-media#daily.dev',
|
|
20
20
|
source: ['/popular'],
|
|
21
21
|
target: '/daily',
|
|
22
22
|
},
|
package/lib/v2/deadline/radar.js
CHANGED
package/lib/v2/discord/radar.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = {
|
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: 'Channel Messages',
|
|
7
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/social-media#discord',
|
|
8
8
|
source: ['/channels/:guildId/:channelId/:messageID', '/channels/:guildId/:channelId'],
|
|
9
9
|
target: '/discord/channel/:channelId',
|
|
10
10
|
},
|
package/lib/v2/dnaindia/radar.js
CHANGED
|
@@ -4,13 +4,13 @@ module.exports = {
|
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: 'News',
|
|
7
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/traditional-media#dna-india',
|
|
8
8
|
source: ['/:category'],
|
|
9
9
|
target: '/dnaindia/:category',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
title: 'Topic',
|
|
13
|
-
docs: 'https://docs.rsshub.app/routes/
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/traditional-media#dna-india',
|
|
14
14
|
source: ['/topic/:topic'],
|
|
15
15
|
target: '/dnaindia/topic/:topic',
|
|
16
16
|
},
|
|
@@ -8,40 +8,54 @@ module.exports = async (ctx) => {
|
|
|
8
8
|
const routeParams = Object.fromEntries(new URLSearchParams(ctx.params.routeParams));
|
|
9
9
|
const playable = fallback(undefined, queryToInteger(routeParams.playable), 0);
|
|
10
10
|
const score = fallback(undefined, queryToInteger(routeParams.score), 0);
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const title = item.title;
|
|
27
|
-
const link = item.url;
|
|
28
|
-
const description = art(path.join(__dirname, '../templates/list_description.art'), {
|
|
29
|
-
ranking_value: item.ranking_value,
|
|
30
|
-
title,
|
|
31
|
-
original_title: item.original_title,
|
|
32
|
-
rate: item.rating ? item.rating.value : null,
|
|
33
|
-
card_subtitle: item.card_subtitle,
|
|
34
|
-
description: item.cards ? item.cards[0].content : item.abstract,
|
|
35
|
-
cover: item.cover_url || item.cover?.url,
|
|
36
|
-
});
|
|
37
|
-
return {
|
|
38
|
-
title,
|
|
39
|
-
link,
|
|
40
|
-
description,
|
|
41
|
-
};
|
|
11
|
+
let start = 0;
|
|
12
|
+
const count = 50;
|
|
13
|
+
let items = [];
|
|
14
|
+
let title = '';
|
|
15
|
+
let description = '';
|
|
16
|
+
let total = null;
|
|
17
|
+
while (total === null || start < total) {
|
|
18
|
+
const url = `https://m.douban.com/rexxar/api/v2/subject_collection/${type}/items?playable=${playable}&start=${start}&count=${count}`;
|
|
19
|
+
// eslint-disable-next-line no-await-in-loop
|
|
20
|
+
const response = await got({
|
|
21
|
+
method: 'get',
|
|
22
|
+
url,
|
|
23
|
+
headers: {
|
|
24
|
+
Referer: `https://m.douban.com/subject_collection/${type}`,
|
|
25
|
+
},
|
|
42
26
|
});
|
|
27
|
+
title = response.data.subject_collection.name;
|
|
28
|
+
description = response.data.subject_collection.description;
|
|
29
|
+
total = response.data.total;
|
|
30
|
+
const newItems = response.data.subject_collection_items
|
|
31
|
+
.filter((item) => {
|
|
32
|
+
const rate = item.rating ? item.rating.value : 0;
|
|
33
|
+
return rate >= score; // 保留rate大于等于score的项and过滤无评分项
|
|
34
|
+
})
|
|
35
|
+
.map((item) => {
|
|
36
|
+
const title = item.title;
|
|
37
|
+
const link = item.url;
|
|
38
|
+
const description = art(path.join(__dirname, '../templates/list_description.art'), {
|
|
39
|
+
ranking_value: item.ranking_value,
|
|
40
|
+
title,
|
|
41
|
+
original_title: item.original_title,
|
|
42
|
+
rate: item.rating ? item.rating.value : null,
|
|
43
|
+
card_subtitle: item.card_subtitle,
|
|
44
|
+
description: item.cards ? item.cards[0].content : item.abstract,
|
|
45
|
+
cover: item.cover_url || item.cover?.url,
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
title,
|
|
49
|
+
link,
|
|
50
|
+
description,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
items = [...items, ...newItems];
|
|
54
|
+
start += count;
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
ctx.state.data = {
|
|
44
|
-
title: `豆瓣 - ${
|
|
58
|
+
title: `豆瓣 - ${title}`,
|
|
45
59
|
link: `https://m.douban.com/subject_collection/${type}`,
|
|
46
60
|
item: items,
|
|
47
61
|
description,
|
|
@@ -2,7 +2,7 @@ const EhAPI = require('./ehapi');
|
|
|
2
2
|
|
|
3
3
|
module.exports = async (ctx) => {
|
|
4
4
|
if (!EhAPI.has_cookie) {
|
|
5
|
-
throw 'Ehentai favorites RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
|
5
|
+
throw new Error('Ehentai favorites RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>');
|
|
6
6
|
}
|
|
7
7
|
const favcat = ctx.params.favcat ? Number.parseInt(ctx.params.favcat) : 0;
|
|
8
8
|
const page = ctx.params.page;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
2
|
+
const { getAccountByUsername, getTimelineByAccountId, parseDescription, baseUrl } = require('./utils');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const { username } = ctx.params;
|
|
6
|
+
|
|
7
|
+
const account = await getAccountByUsername(username, ctx.cache.tryGet);
|
|
8
|
+
const timeline = await getTimelineByAccountId(account.id);
|
|
9
|
+
|
|
10
|
+
const items = timeline.posts.map((post) => ({
|
|
11
|
+
title: post.content.split('\n')[0],
|
|
12
|
+
description: parseDescription(post, timeline),
|
|
13
|
+
pubDate: parseDate(post.createdAt, 'X'),
|
|
14
|
+
link: `${baseUrl}/post/${post.id}`,
|
|
15
|
+
author: `${account.displayName ?? account.username} (@${account.username})`,
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
ctx.state.data = {
|
|
19
|
+
title: `${account.displayName ?? account.username} (@${account.username}) - Fansly`,
|
|
20
|
+
link: `${baseUrl}/${account.username}`,
|
|
21
|
+
description: account.about.replaceAll('\n', ' '),
|
|
22
|
+
image: account.banner.locations[0].location,
|
|
23
|
+
icon: account.avatar.locations[0].location,
|
|
24
|
+
logo: account.avatar.locations[0].location,
|
|
25
|
+
language: 'en',
|
|
26
|
+
allowEmpty: true,
|
|
27
|
+
item: items,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'fansly.com': {
|
|
3
|
+
_name: 'Fansly',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: 'User Timeline',
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/social-media.html#fansly',
|
|
8
|
+
source: ['/:username/posts', '/:username/media'],
|
|
9
|
+
target: '/fansly/user/:username',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: 'Hashtag',
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/social-media.html#fansly',
|
|
14
|
+
source: ['/explore/tag/:tag'],
|
|
15
|
+
target: '/fansly/tag/:tag',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
2
|
+
const { getTagId, getTagSuggestion, findAccountById, parseDescription, baseUrl, icon } = require('./utils');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const { tag } = ctx.params;
|
|
6
|
+
|
|
7
|
+
const tagId = await getTagId(tag, ctx.cache.tryGet);
|
|
8
|
+
const suggestion = await getTagSuggestion(tagId);
|
|
9
|
+
|
|
10
|
+
const items = suggestion.aggregationData?.posts.map((post) => {
|
|
11
|
+
const account = findAccountById(post.accountId, suggestion.aggregationData.accounts);
|
|
12
|
+
return {
|
|
13
|
+
title: post.content.split('\n')[0],
|
|
14
|
+
description: parseDescription(post, suggestion.aggregationData),
|
|
15
|
+
pubDate: parseDate(post.createdAt, 'X'),
|
|
16
|
+
link: `${baseUrl}/post/${post.id}`,
|
|
17
|
+
author: `${account.displayName ?? account.username} (@${account.username})`,
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
ctx.state.data = {
|
|
22
|
+
title: `#${tag} - Fansly`,
|
|
23
|
+
link: `${baseUrl}/explore/tag/${tag}`,
|
|
24
|
+
image: icon,
|
|
25
|
+
icon,
|
|
26
|
+
logo: icon,
|
|
27
|
+
language: 'en',
|
|
28
|
+
item: items,
|
|
29
|
+
};
|
|
30
|
+
};
|