rsshub 1.0.0-master.f7cdf8b → 1.0.0-master.f7f8b7a
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/README.md +3 -3
- package/lib/config.js +21 -8
- package/lib/middleware/cache/index.js +4 -3
- package/lib/middleware/cache/redis.js +3 -3
- package/lib/middleware/onerror.js +8 -0
- package/lib/middleware/template.js +79 -85
- package/lib/router.js +7 -7
- package/lib/routes/index.js +6 -13
- package/lib/utils/common-utils.js +2 -6
- package/lib/utils/render.js +2 -0
- package/lib/v2/1point3acres/maintainer.js +2 -2
- package/lib/v2/95mm/utils.js +3 -2
- package/lib/v2/aliyun/notice.js +1 -1
- package/lib/v2/amazon/maintainer.js +1 -1
- package/lib/v2/apnews/topics.js +1 -1
- package/lib/v2/arcteryx/maintainer.js +3 -3
- package/lib/v2/bangumi/maintainer.js +1 -0
- package/lib/v2/bangumi/radar.js +6 -0
- package/lib/v2/bangumi/router.js +1 -0
- package/lib/v2/bangumi/tv/user/wish.js +38 -0
- package/lib/v2/bellroy/maintainer.js +1 -1
- package/lib/v2/bilibili/cache.js +10 -7
- package/lib/v2/bilibili/maintainer.js +1 -0
- package/lib/v2/bilibili/platform.js +43 -0
- package/lib/v2/bilibili/radar.js +8 -0
- package/lib/v2/bilibili/router.js +1 -0
- package/lib/v2/bilibili/video.js +8 -1
- package/lib/v2/bossdesign/index.js +41 -0
- package/lib/v2/bossdesign/maintainer.js +3 -0
- package/lib/v2/bossdesign/radar.js +13 -0
- package/lib/v2/bossdesign/router.js +3 -0
- package/lib/v2/brave/latest.js +4 -2
- package/lib/v2/buaa/maintainer.js +4 -0
- package/lib/v2/buaa/news/index.js +46 -0
- package/lib/v2/buaa/radar.js +21 -0
- package/lib/v2/buaa/router.js +4 -0
- package/lib/v2/buaa/sme.js +59 -0
- package/lib/v2/cfachina/analygarden.js +60 -0
- package/lib/v2/cfachina/maintainer.js +3 -0
- package/lib/v2/cfachina/radar.js +13 -0
- package/lib/v2/cfachina/router.js +3 -0
- package/lib/v2/cna/maintainer.js +1 -0
- package/lib/v2/cna/radar.js +6 -0
- package/lib/v2/cna/router.js +1 -0
- package/lib/v2/cna/web/index.js +62 -0
- package/lib/v2/cste/radar.js +1 -1
- package/lib/v2/dahecube/radar.js +40 -4
- package/lib/v2/dongqiudi/utils.js +1 -1
- package/lib/v2/douban/maintainer.js +1 -0
- package/lib/v2/douban/other/discussion.js +58 -0
- package/lib/v2/douban/radar.js +8 -0
- package/lib/v2/douban/router.js +1 -0
- package/lib/v2/dut/defaults.js +4 -0
- package/lib/v2/dut/index.js +21 -9
- package/lib/v2/dut/maintainer.js +8 -7
- package/lib/v2/dut/radar.js +37 -29
- package/lib/v2/dut/shortcuts.js +5 -0
- package/lib/v2/egsea/flash.js +30 -0
- package/lib/v2/egsea/maintainer.js +3 -0
- package/lib/v2/egsea/radar.js +13 -0
- package/lib/v2/egsea/router.js +3 -0
- package/lib/v2/fisher-spb/news.js +1 -2
- package/lib/v2/fosshub/radar.js +1 -1
- package/lib/v2/fxiaoke/crm.js +63 -0
- package/lib/v2/fxiaoke/maintainer.js +3 -0
- package/lib/v2/fxiaoke/radar.js +37 -0
- package/lib/v2/fxiaoke/router.js +3 -0
- package/lib/v2/gdsrx/index.js +72 -0
- package/lib/v2/gdsrx/maintainer.js +3 -0
- package/lib/v2/gdsrx/radar.js +61 -0
- package/lib/v2/gdsrx/router.js +3 -0
- package/lib/v2/gogoanimehd/radar.js +1 -1
- package/lib/v2/gogoanimehd/recent-releases.js +1 -1
- package/lib/v2/google/alerts.js +33 -0
- package/lib/v2/google/maintainer.js +1 -0
- package/lib/v2/google/router.js +1 -0
- package/lib/v2/gov/maintainer.js +9 -2
- package/lib/v2/gov/moa/zdscxx.js +104 -0
- package/lib/v2/gov/mot/index.js +66 -0
- package/lib/v2/gov/nea/ghs.js +58 -0
- package/lib/v2/gov/nifdc/index.js +40 -33
- package/lib/v2/gov/radar.js +232 -4
- package/lib/v2/gov/router.js +10 -2
- package/lib/v2/gov/safe/business.js +8 -0
- package/lib/v2/gov/safe/complaint.js +8 -0
- package/lib/v2/gov/safe/templates/message.art +25 -0
- package/lib/v2/gov/safe/util.js +87 -0
- package/lib/v2/gov/zhengce/index.js +99 -0
- package/lib/v2/greasyfork/maintainer.js +1 -0
- package/lib/v2/greasyfork/router.js +1 -0
- package/lib/v2/greasyfork/scripts.js +25 -20
- package/lib/{routes/universities → v2}/harvard/health/blog.js +8 -7
- package/lib/v2/harvard/maintainer.js +3 -0
- package/lib/v2/harvard/radar.js +13 -0
- package/lib/v2/harvard/router.js +3 -0
- package/lib/v2/huxiu/briefColumn.js +13 -25
- package/lib/v2/huxiu/channel.js +28 -0
- package/lib/v2/huxiu/club.js +30 -0
- package/lib/v2/huxiu/collection.js +14 -26
- package/lib/v2/huxiu/maintainer.js +8 -5
- package/lib/v2/huxiu/member.js +27 -0
- package/lib/v2/huxiu/moment.js +11 -25
- package/lib/v2/huxiu/radar.js +24 -16
- package/lib/v2/huxiu/router.js +7 -4
- package/lib/v2/huxiu/search.js +16 -21
- package/lib/v2/huxiu/tag.js +13 -25
- package/lib/v2/huxiu/templates/description.art +46 -0
- package/lib/v2/huxiu/util.js +460 -0
- package/lib/v2/ifi-audio/maintainer.js +1 -1
- package/lib/v2/imiker/jinghua.js +87 -0
- package/lib/v2/imiker/maintainer.js +3 -0
- package/lib/v2/imiker/radar.js +13 -0
- package/lib/v2/imiker/router.js +3 -0
- package/lib/v2/imiker/templates/description.art +32 -0
- package/lib/v2/inoreader/maintainer.js +1 -1
- package/lib/v2/instagram/common-utils.js +7 -4
- package/lib/v2/instagram/templates/images.art +9 -2
- package/lib/v2/instagram/templates/video.art +4 -1
- package/lib/v2/instagram/web-api/index.js +30 -9
- package/lib/v2/instagram/web-api/utils.js +149 -25
- package/lib/v2/kemono/index.js +26 -2
- package/lib/v2/kemono/radar.js +1 -1
- package/lib/v2/kepu/live.js +89 -0
- package/lib/v2/kepu/maintainer.js +3 -0
- package/lib/v2/kepu/radar.js +13 -0
- package/lib/v2/kepu/router.js +3 -0
- package/lib/v2/kepu/templates/description.art +33 -0
- package/lib/v2/leetcode/maintainer.js +1 -1
- package/lib/v2/lightnovel/lightNovel.js +62 -0
- package/lib/v2/lightnovel/maintainer.js +3 -0
- package/lib/v2/lightnovel/radar.js +13 -0
- package/lib/v2/lightnovel/router.js +3 -0
- package/lib/v2/line/radar.js +1 -1
- package/lib/v2/liquipedia/cs_matches.js +52 -0
- package/lib/v2/liquipedia/dota2_matches.js +47 -0
- package/lib/v2/liquipedia/maintainer.js +4 -0
- package/lib/v2/liquipedia/radar.js +19 -0
- package/lib/v2/liquipedia/router.js +4 -0
- package/lib/v2/magazinelib/maintainer.js +1 -1
- package/lib/v2/mihoyo/radar.js +1 -1
- package/lib/v2/missav/maintainer.js +3 -0
- package/lib/v2/missav/new.js +36 -0
- package/lib/v2/missav/radar.js +13 -0
- package/lib/v2/missav/router.js +3 -0
- package/lib/v2/missav/templates/preview.art +3 -0
- package/lib/v2/modb/maintainer.js +3 -0
- package/lib/v2/modb/radar.js +13 -0
- package/lib/v2/modb/router.js +3 -0
- package/lib/v2/modb/topic.js +59 -0
- package/lib/v2/nature/cover.js +32 -42
- package/lib/v2/nature/highlight.js +2 -2
- package/lib/v2/nature/news-and-comment.js +2 -2
- package/lib/v2/nature/news.js +2 -2
- package/lib/v2/nature/research.js +2 -2
- package/lib/v2/nature/siteindex.js +5 -5
- package/lib/v2/nature/utils.js +124 -5
- package/lib/v2/ncu/jwc.js +33 -0
- package/lib/v2/ncu/maintainer.js +3 -0
- package/lib/v2/ncu/radar.js +13 -0
- package/lib/v2/ncu/router.js +3 -0
- package/lib/v2/nmtv/radar.js +1 -1
- package/lib/v2/oo-software/radar.js +1 -1
- package/lib/v2/patagonia/maintainer.js +1 -1
- package/lib/v2/phoronix/index.js +177 -48
- package/lib/v2/phoronix/maintainer.js +1 -1
- package/lib/v2/phoronix/radar.js +3 -3
- package/lib/v2/phoronix/router.js +1 -1
- package/lib/v2/picnob/maintainer.js +1 -1
- package/lib/v2/picnob/templates/desc.art +3 -3
- package/lib/v2/picnob/user.js +74 -37
- package/lib/v2/picnob/utils.js +24 -0
- package/lib/v2/qbitai/category.js +27 -0
- package/lib/v2/qbitai/maintainer.js +4 -0
- package/lib/v2/qbitai/radar.js +19 -0
- package/lib/v2/qbitai/router.js +4 -0
- package/lib/v2/qbitai/tag.js +27 -0
- package/lib/v2/questmobile/maintainer.js +3 -0
- package/lib/v2/questmobile/radar.js +18 -0
- package/lib/v2/questmobile/report.js +127 -0
- package/lib/v2/questmobile/router.js +3 -0
- package/lib/v2/questmobile/templates/description.art +17 -0
- package/lib/v2/readhub/daily.js +43 -0
- package/lib/v2/readhub/index.js +19 -72
- package/lib/v2/readhub/maintainer.js +1 -0
- package/lib/v2/readhub/radar.js +6 -0
- package/lib/v2/readhub/router.js +1 -0
- package/lib/v2/readhub/util.js +69 -0
- package/lib/v2/routledge/book-series.js +78 -0
- package/lib/v2/routledge/maintainer.js +3 -0
- package/lib/v2/routledge/radar.js +13 -0
- package/lib/v2/routledge/router.js +3 -0
- package/lib/v2/routledge/templates/description.art +7 -0
- package/lib/v2/showstart/artist.js +15 -0
- package/lib/v2/showstart/brand.js +15 -0
- package/lib/v2/showstart/const.js +4 -0
- package/lib/v2/showstart/event.js +18 -0
- package/lib/v2/showstart/maintainer.js +6 -0
- package/lib/v2/showstart/radar.js +40 -0
- package/lib/v2/showstart/router.js +6 -0
- package/lib/v2/showstart/search.js +51 -0
- package/lib/v2/showstart/service.js +166 -0
- package/lib/v2/showstart/utils.js +92 -0
- package/lib/v2/snowpeak/maintainer.js +1 -1
- package/lib/v2/sony/maintainer.js +1 -1
- package/lib/v2/sse/disclosure.js +4 -3
- package/lib/v2/sspu/jwc.js +44 -0
- package/lib/v2/sspu/maintainer.js +3 -0
- package/lib/v2/sspu/radar.js +13 -0
- package/lib/v2/sspu/router.js +3 -0
- package/lib/v2/techcrunch/maintainer.js +1 -1
- package/lib/v2/theatlantic/maintainer.js +1 -1
- package/lib/v2/thepaper/radar.js +2 -2
- package/lib/v2/threads/index.js +20 -150
- package/lib/v2/threads/utils.js +147 -0
- package/lib/v2/twitter/keyword.js +1 -3
- package/lib/v2/twitter/media.js +1 -5
- package/lib/v2/twitter/user.js +1 -3
- package/lib/v2/twitter/utils.js +5 -3
- package/lib/v2/twitter/web-api/constants.js +80 -68
- package/lib/v2/twitter/web-api/twitter-api.js +96 -103
- package/lib/v2/uniqlo/maintainer.js +3 -0
- package/lib/v2/uniqlo/new.js +62 -0
- package/lib/v2/uniqlo/radar.js +12 -0
- package/lib/v2/uniqlo/router.js +3 -0
- package/lib/v2/wechat/maintainer.js +1 -1
- package/lib/v2/weibo/maintainer.js +1 -1
- package/lib/v2/weibo/radar.js +1 -1
- package/lib/v2/weibo/router.js +1 -1
- package/lib/v2/weibo/search/hot.js +118 -7
- package/lib/v2/weibo/search/template/digest.art +17 -0
- package/lib/v2/xiaohongshu/util.js +17 -7
- package/lib/v2/xmnn/docs.js +0 -0
- package/lib/v2/xmnn/maintainer.js +1 -0
- package/lib/v2/xmnn/news.js +65 -0
- package/lib/v2/xmnn/radar.js +67 -1
- package/lib/v2/xmnn/router.js +1 -0
- package/lib/v2/xsijishe/maintainer.js +1 -0
- package/lib/v2/xsijishe/radar.js +12 -0
- package/lib/v2/xsijishe/rank.js +60 -0
- package/lib/v2/xsijishe/router.js +1 -0
- package/lib/v2/yahoo/maintainer.js +2 -0
- package/lib/v2/yahoo/news/tw/index.js +24 -0
- package/lib/v2/yahoo/news/tw/provider-helper.js +22 -0
- package/lib/v2/yahoo/news/tw/provider.js +24 -0
- package/lib/v2/yahoo/news/tw/utils.js +129 -0
- package/lib/v2/yahoo/radar.js +29 -1
- package/lib/v2/yahoo/router.js +4 -1
- package/lib/v2/yahoo/templates/youtube.art +1 -0
- package/lib/v2/yuque/book.js +6 -1
- package/lib/v2/yuque/utils.js +16 -0
- package/lib/v2/zagg/maintainer.js +1 -1
- package/lib/views/error.art +1 -1
- package/lib/views/rss3-ums.js +62 -0
- package/lib/views/welcome.art +1 -1
- package/package.json +45 -39
- package/lib/routes/egsea/flash.js +0 -40
- package/lib/routes/gov/moa/sjzxfb.js +0 -20
- package/lib/routes/liquipedia/dota2_matches.js +0 -50
- package/lib/routes/questmobile/report.js +0 -121
- package/lib/routes/uniqlo/stylingbook.js +0 -24
- package/lib/routes/universities/buaa/news/index.js +0 -66
- package/lib/routes/universities/buaa/utils.js +0 -57
- package/lib/v2/gov/zhengce/zuixin.js +0 -39
- package/lib/v2/huxiu/article.js +0 -33
- package/lib/v2/huxiu/author.js +0 -36
- package/lib/v2/huxiu/templates/brief.art +0 -22
- package/lib/v2/huxiu/templates/img.art +0 -3
- package/lib/v2/huxiu/templates/moment.art +0 -16
- package/lib/v2/huxiu/templates/video.art +0 -7
- package/lib/v2/huxiu/utils.js +0 -154
- package/lib/v2/twitter/web-api/twitter-got.js +0 -113
- /package/lib/{routes → v2}/gov/moa/moa.js +0 -0
- /package/lib/v2/yahoo/news/{index.js → us/index.js} +0 -0
package/lib/v2/bilibili/cache.js
CHANGED
|
@@ -13,20 +13,23 @@ module.exports = {
|
|
|
13
13
|
return ctx.cache.tryGet(key, async () => {
|
|
14
14
|
// default Referer: https://www.bilibili.com is limited
|
|
15
15
|
// Bilibili return cookies with multiple set-cookie
|
|
16
|
-
let response = await got('https://space.bilibili.com/1');
|
|
17
|
-
const setCookie = response.headers['set-cookie']; // should contain buvid3 and b_nut
|
|
18
|
-
if (typeof setCookie === 'undefined') {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const cookie = setCookie.map((cookie) => cookie.split(';')[0]);
|
|
16
|
+
// let response = await got('https://space.bilibili.com/1');
|
|
17
|
+
// const setCookie = response.headers['set-cookie']; // should contain buvid3 and b_nut
|
|
18
|
+
// if (typeof setCookie === 'undefined') {
|
|
19
|
+
// return '';
|
|
20
|
+
// }
|
|
21
|
+
// const cookie = setCookie.map((cookie) => cookie.split(';')[0]);
|
|
22
|
+
const cookie = [];
|
|
22
23
|
cookie.push(['b_lsid', utils.lsid()].join('='));
|
|
23
24
|
cookie.push(['_uuid', utils._uuid()].join('='));
|
|
24
|
-
|
|
25
|
+
cookie.push(['b_nut', Date.now().toString()].join('='));
|
|
26
|
+
let response = await got('https://api.bilibili.com/x/frontend/finger/spi', {
|
|
25
27
|
headers: {
|
|
26
28
|
Referer: 'https://www.bilibili.com/',
|
|
27
29
|
Cookie: cookie.join('; '),
|
|
28
30
|
},
|
|
29
31
|
});
|
|
32
|
+
cookie.push(['buvid3', encodeURIComponent(response.data.data.b_3)].join('='));
|
|
30
33
|
cookie.push(['bvuid4', encodeURIComponent(response.data.data.b_4)].join('='));
|
|
31
34
|
const e = Math.floor(Date.now() / 1000);
|
|
32
35
|
const hexsign = utils.hexsign(e);
|
|
@@ -21,6 +21,7 @@ module.exports = {
|
|
|
21
21
|
'/online/:disableEmbed?': ['TigerCubDen'],
|
|
22
22
|
'/partion/:tid/:disableEmbed?': ['DIYgod'],
|
|
23
23
|
'/partion/ranking/:tid/:days?/:disableEmbed?': ['lengthmin'],
|
|
24
|
+
'/platform/:area?/:p_type?/:uid?': ['nightmare-mio'],
|
|
24
25
|
'/popular/all': ['ziminliu'],
|
|
25
26
|
'/ranking/:rid?/:day?/:arc_type?/:disableEmbed?': ['DIYgod'],
|
|
26
27
|
'/readlist/:listid': ['hoilc'],
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const config = require('@/config').value;
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const { area = -1, type = '全部类型', uid } = ctx.params;
|
|
7
|
+
const cookie = config.bilibili.cookies[uid];
|
|
8
|
+
const link = 'https://show.bilibili.com/api/ticket/project/listV2';
|
|
9
|
+
|
|
10
|
+
const headers = {
|
|
11
|
+
Referer: 'https://space.bilibili.com',
|
|
12
|
+
Cookie: cookie ? `SESSDATA=${cookie}` : undefined,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const { data: response } = await got({
|
|
16
|
+
method: 'get',
|
|
17
|
+
url: `${link}?version=134&page=1&pagesize=16&area=${area}&filter=&platform=web&p_type=${type}`,
|
|
18
|
+
headers,
|
|
19
|
+
});
|
|
20
|
+
// 列表
|
|
21
|
+
const list = response.data.result;
|
|
22
|
+
|
|
23
|
+
const items = list.map((item) => {
|
|
24
|
+
const bodyHtml = `<img src="${item.cover}"></img>`;
|
|
25
|
+
const coordinate = `<div>活动地点: ${item.city} ${item.venue_name}</div>`;
|
|
26
|
+
const liveTime = `<div>活动时间: ${item.tlabel}</div>`;
|
|
27
|
+
const staff = `<div>参展览嘉宾: ${item.staff}</div>`;
|
|
28
|
+
const countdown = `<div>结束日期: ${item.countdown}</div>`;
|
|
29
|
+
const price = `<div>最低价: ${item.price_low / 100} ; 最高价: ${item.price_high / 100}</div>`;
|
|
30
|
+
return {
|
|
31
|
+
title: item.project_name,
|
|
32
|
+
link: item.url,
|
|
33
|
+
description: bodyHtml + coordinate + liveTime + staff + countdown + price,
|
|
34
|
+
pubDate: parseDate(item.sale_start_time * 1000),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
ctx.state.data = {
|
|
39
|
+
title: `bilibili会员购票务-${area}`,
|
|
40
|
+
link,
|
|
41
|
+
item: items,
|
|
42
|
+
};
|
|
43
|
+
};
|
package/lib/v2/bilibili/radar.js
CHANGED
|
@@ -143,5 +143,13 @@ module.exports = {
|
|
|
143
143
|
target: '/bilibili/live/room/:roomID',
|
|
144
144
|
},
|
|
145
145
|
],
|
|
146
|
+
show: [
|
|
147
|
+
{
|
|
148
|
+
title: '会员购票务',
|
|
149
|
+
docs: 'https://docs.rsshub.app/routes/social-media#bilibili-hui-yuan-gou-zuo-pin',
|
|
150
|
+
source: '/platform',
|
|
151
|
+
target: '/bilibili/platform/:area?/:p_type?/:uid?',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
146
154
|
},
|
|
147
155
|
};
|
|
@@ -21,6 +21,7 @@ module.exports = (router) => {
|
|
|
21
21
|
router.get('/online/:disableEmbed?', require('./online'));
|
|
22
22
|
router.get('/partion/:tid/:disableEmbed?', require('./partion'));
|
|
23
23
|
router.get('/partion/ranking/:tid/:days?/:disableEmbed?', require('./partion-ranking'));
|
|
24
|
+
router.get('/platform/:area?/:p_type?/:uid?', require('./platform'));
|
|
24
25
|
router.get('/popular/all', require('./popular'));
|
|
25
26
|
router.get('/ranking/:rid?/:day?/:arc_type?/:disableEmbed?', require('./ranking'));
|
|
26
27
|
router.get('/readlist/:listid', require('./readlist'));
|
package/lib/v2/bilibili/video.js
CHANGED
|
@@ -16,7 +16,14 @@ module.exports = async (ctx) => {
|
|
|
16
16
|
// Cookie: cookie,
|
|
17
17
|
// },
|
|
18
18
|
// });
|
|
19
|
-
const params = utils.addVerifyInfo(
|
|
19
|
+
const params = utils.addVerifyInfo(
|
|
20
|
+
`mid=${uid}&ps=30&tid=0&pn=1&keyword=&order=pubdate&platform=web&web_location=1550101&order_avoided=true&dm_img_list=[]&dm_img_str=${Buffer.from('no webgl').toString('base64').slice(0, -2)}&dm_cover_img_str=${Buffer.from(
|
|
21
|
+
'no webgl'
|
|
22
|
+
)
|
|
23
|
+
.toString('base64')
|
|
24
|
+
.slice(0, -2)}`,
|
|
25
|
+
verifyString
|
|
26
|
+
);
|
|
20
27
|
const response = await got(`https://api.bilibili.com/x/space/wbi/arc/search?${params}`, {
|
|
21
28
|
headers: {
|
|
22
29
|
Referer: `https://space.bilibili.com/${uid}/video?tid=0&page=1&keyword=&order=pubdate`,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const { category } = ctx.params;
|
|
6
|
+
const limit = parseInt(ctx.query.limit, 10) || undefined;
|
|
7
|
+
const baseUrl = 'https://www.bossdesign.cn';
|
|
8
|
+
|
|
9
|
+
const currentCategory = await ctx.cache.tryGet(`bossdesign:categories:${category}`, async () => {
|
|
10
|
+
const { data: categories } = await got(`${baseUrl}/wp-json/wp/v2/categories`);
|
|
11
|
+
return categories.find((item) => item.slug === category || item.name === category);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const categoryId = currentCategory?.id;
|
|
15
|
+
|
|
16
|
+
const { data: posts } = await got(`${baseUrl}/wp-json/wp/v2/posts`, {
|
|
17
|
+
searchParams: {
|
|
18
|
+
categories: categoryId,
|
|
19
|
+
per_page: limit,
|
|
20
|
+
_embed: '',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const items = posts.map((item) => ({
|
|
25
|
+
title: item.title.rendered,
|
|
26
|
+
description: item.content.rendered,
|
|
27
|
+
pubDate: parseDate(item.date_gmt),
|
|
28
|
+
updated: parseDate(item.modified_gmt),
|
|
29
|
+
link: item.link,
|
|
30
|
+
guid: item.guid.rendered,
|
|
31
|
+
category: [...new Set([...item._embedded['wp:term'][0].map((item) => item.name), ...item._embedded['wp:term'][1].map((item) => item.name)])],
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
ctx.state.data = {
|
|
35
|
+
title: currentCategory?.name ? `${currentCategory.name} | Boss设计` : 'Boss设计 | 收集国外设计素材网站的资源平台。',
|
|
36
|
+
description: currentCategory?.description ?? 'Boss设计-收集国外设计素材网站的资源平台。专注于收集国外设计素材和国外设计网站,以及超实用的设计师神器,只为设计初学者和设计师提供海量的资源平台。..',
|
|
37
|
+
image: currentCategory?.cover ?? `${baseUrl}/wp-content/themes/pinghsu/images/Bossdesign-ico.ico`,
|
|
38
|
+
link: currentCategory?.link ?? baseUrl,
|
|
39
|
+
item: items,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'bossdesign.cn': {
|
|
3
|
+
_name: 'Boss 设计',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '分类',
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/design#boss-she-ji',
|
|
8
|
+
source: ['/:category?', '/'],
|
|
9
|
+
target: (params) => `/bossdesign${params.category ? `/${params.category}` : ''}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
package/lib/v2/brave/latest.js
CHANGED
|
@@ -20,13 +20,15 @@ module.exports = async (ctx) => {
|
|
|
20
20
|
|
|
21
21
|
const title = item.text();
|
|
22
22
|
const device = item.parent().find('h2').text();
|
|
23
|
+
const matchVersion = title.match(/(v[\d.]+)/);
|
|
24
|
+
const matchDate = title.match(/\((.*?)\)/);
|
|
23
25
|
|
|
24
26
|
return {
|
|
25
27
|
title: `[${device}] ${title}`,
|
|
26
28
|
link: currentUrl,
|
|
27
|
-
guid: `${currentUrl}#${device}-${
|
|
29
|
+
guid: `${currentUrl}#${device}-${matchVersion?.[1] ?? title}`,
|
|
28
30
|
description: item.next().html(),
|
|
29
|
-
pubDate: parseDate(
|
|
31
|
+
pubDate: parseDate(matchDate?.[1].replace(/(st|nd|rd|th)?,/, ''), ['MMMM D YYYY', 'MMM D YYYY']),
|
|
30
32
|
};
|
|
31
33
|
});
|
|
32
34
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const baseUrl = 'https://news.buaa.edu.cn';
|
|
8
|
+
const { type } = ctx.params;
|
|
9
|
+
|
|
10
|
+
const { data: response, url: link } = await got(`${baseUrl}/${type}.htm`);
|
|
11
|
+
|
|
12
|
+
const $ = cheerio.load(response);
|
|
13
|
+
const title = $('.subnav span').text().trim();
|
|
14
|
+
const list = $('.mainleft > .listlefttop > .listleftop1')
|
|
15
|
+
.toArray()
|
|
16
|
+
.map((item) => {
|
|
17
|
+
item = $(item);
|
|
18
|
+
const title = item.find('h2 > a');
|
|
19
|
+
return {
|
|
20
|
+
title: title.text(),
|
|
21
|
+
link: new URL(title.attr('href'), baseUrl).href,
|
|
22
|
+
pubDate: timezone(parseDate(item.find('h2 em').text(), '[YYYY-MM-DD]'), +8),
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const result = await Promise.all(
|
|
27
|
+
list.map((item) =>
|
|
28
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
29
|
+
const response = await got(item.link);
|
|
30
|
+
const $ = cheerio.load(response.data);
|
|
31
|
+
|
|
32
|
+
item.description = $('.v_news_content').html();
|
|
33
|
+
item.author = $('.vsbcontent_end').text().trim();
|
|
34
|
+
|
|
35
|
+
return item;
|
|
36
|
+
})
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
ctx.state.data = {
|
|
41
|
+
title: `北航新闻 - ${title}`,
|
|
42
|
+
link,
|
|
43
|
+
description: `北京航空航天大学新闻网 - ${title}`,
|
|
44
|
+
item: result,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'buaa.edu.cn': {
|
|
3
|
+
_name: '北京航空航天大学',
|
|
4
|
+
news: [
|
|
5
|
+
{
|
|
6
|
+
title: '新闻网',
|
|
7
|
+
docs: 'https://docs.rsshub.app/routes/university#bei-jing-hang-kong-hang-tian-da-xue',
|
|
8
|
+
source: ['/*'],
|
|
9
|
+
target: (_, url) => `/buaa/news${new URL(url).pathname.replace('.htm', '')}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
'www.sme': [
|
|
13
|
+
{
|
|
14
|
+
title: '集成电路科学与工程学院',
|
|
15
|
+
docs: 'https://docs.rsshub.app/routes/university#bei-jing-hang-kong-hang-tian-da-xue-ji-cheng-dian-lu-ke-xue-yu-gong-cheng-xue-yuan',
|
|
16
|
+
source: ['/*'],
|
|
17
|
+
target: (_, url) => `/buaa/sme${new URL(url).pathname.replace('.htm', '')}`,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
const BASE_URL = 'http://www.sme.buaa.edu.cn';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const { path = 'tzgg' } = ctx.params;
|
|
10
|
+
const url = `${BASE_URL}/${path}.htm`;
|
|
11
|
+
const { title, list } = await getList(url);
|
|
12
|
+
ctx.state.data = {
|
|
13
|
+
// 源标题
|
|
14
|
+
title,
|
|
15
|
+
// 源链接
|
|
16
|
+
link: url,
|
|
17
|
+
// 源文章
|
|
18
|
+
item: await getItems(ctx, list),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
async function getList(url) {
|
|
23
|
+
const { data } = await got(url);
|
|
24
|
+
const $ = cheerio.load(data);
|
|
25
|
+
const title = $('.nytit .fr a')
|
|
26
|
+
.toArray()
|
|
27
|
+
.slice(1)
|
|
28
|
+
.map((item) => $(item).text().trim())
|
|
29
|
+
.join(' - ');
|
|
30
|
+
const list = $("div[class='Newslist'] > ul > li")
|
|
31
|
+
.toArray()
|
|
32
|
+
.map((item) => {
|
|
33
|
+
item = $(item);
|
|
34
|
+
const $a = item.find('a');
|
|
35
|
+
const link = $a.attr('href');
|
|
36
|
+
return {
|
|
37
|
+
title: item.find('a').text(),
|
|
38
|
+
link: link.startsWith('http') ? link : `${BASE_URL}/${link}`, // 有些链接是相对路径
|
|
39
|
+
pubDate: timezone(parseDate(item.find('span').text()), +8),
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
title,
|
|
44
|
+
list,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getItems(ctx, list) {
|
|
49
|
+
return Promise.all(
|
|
50
|
+
list.map((item) =>
|
|
51
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
52
|
+
const { data: descrptionResponse } = await got(item.link);
|
|
53
|
+
const $descrption = cheerio.load(descrptionResponse);
|
|
54
|
+
item.description = $descrption('div[class="v_news_content"]').html();
|
|
55
|
+
return item;
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
let { program = '分析师园地' } = ctx.params;
|
|
8
|
+
const baseUrl = 'https://www.cfachina.org';
|
|
9
|
+
let pageData,
|
|
10
|
+
pageUrl = `${baseUrl}/servicesupport/analygarden/`;
|
|
11
|
+
|
|
12
|
+
if (program !== '分析师园地') {
|
|
13
|
+
pageUrl = `${pageUrl}${program}/`;
|
|
14
|
+
|
|
15
|
+
const response = await got(pageUrl);
|
|
16
|
+
const $ = cheerio.load(response.data);
|
|
17
|
+
program = $('script:contains("Paging")')
|
|
18
|
+
.text()
|
|
19
|
+
.match(/var name = '(.+)';/)[1];
|
|
20
|
+
pageData = {
|
|
21
|
+
category: $('.crumb a')
|
|
22
|
+
.toArray()
|
|
23
|
+
.map((item) => $(item).text())
|
|
24
|
+
.slice(-2),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { data: response } = await got(`${baseUrl}/qx-search/api/wcmSearch/getDataByProgram`, {
|
|
29
|
+
headers: {
|
|
30
|
+
accept: 'application/json, text/plain, */*',
|
|
31
|
+
},
|
|
32
|
+
searchParams: {
|
|
33
|
+
pageNo: 1,
|
|
34
|
+
pageSize: ctx.query.limit ? parseInt(ctx.query.limit, 10) : 20,
|
|
35
|
+
keyword: '',
|
|
36
|
+
startTime: '',
|
|
37
|
+
endTime: '',
|
|
38
|
+
type: '',
|
|
39
|
+
programName: program,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const items = response.data.dataList.map((item) => {
|
|
44
|
+
const link = new URL(item.docPubUrl, baseUrl).href;
|
|
45
|
+
return {
|
|
46
|
+
title: item.docTitle,
|
|
47
|
+
author: item.docAuthor,
|
|
48
|
+
link,
|
|
49
|
+
pubDate: timezone(parseDate(item.operTime), +8),
|
|
50
|
+
enclosure_url: link,
|
|
51
|
+
enclosure_type: `application/${link.split('.').pop()}`,
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
ctx.state.data = {
|
|
56
|
+
title: `${pageData?.category.toReversed().join(' - ') ?? '分析师园地'} - 中国期货业协会`,
|
|
57
|
+
link: pageUrl,
|
|
58
|
+
item: items,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'cfachina.org': {
|
|
3
|
+
_name: '中国期货业协会',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '分析师园地',
|
|
7
|
+
docs: 'https://docs.rsshub.app/other#zhong-guo-qi-huo-ye-xie-hui',
|
|
8
|
+
source: ['/servicesupport/analygarden/:program?', '/'],
|
|
9
|
+
target: '/cfachina/servicesupport/analygarden/:program?',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
package/lib/v2/cna/maintainer.js
CHANGED
package/lib/v2/cna/radar.js
CHANGED
|
@@ -8,6 +8,12 @@ module.exports = {
|
|
|
8
8
|
source: ['/list/:id', '/topic/newstopic/:id'],
|
|
9
9
|
target: (params) => `/cna/${params.id.replace('.aspx', '')}`,
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
title: '分类(网页爬虫方法)',
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/traditional-media#zhong-yang-tong-xun-she',
|
|
14
|
+
source: ['/list/:id'],
|
|
15
|
+
target: (params) => `/cna/web/${params.id.replace('.aspx', '')}`,
|
|
16
|
+
},
|
|
11
17
|
],
|
|
12
18
|
},
|
|
13
19
|
};
|
package/lib/v2/cna/router.js
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const id = ctx.params.id || 'aall';
|
|
8
|
+
|
|
9
|
+
let rootUrl;
|
|
10
|
+
|
|
11
|
+
if (/^\d+$/.test(id)) {
|
|
12
|
+
rootUrl = `https://www.cna.com.tw/topic/newstopic/${id}.aspx`;
|
|
13
|
+
} else {
|
|
14
|
+
rootUrl = `https://www.cna.com.tw/list/${id}.aspx`;
|
|
15
|
+
}
|
|
16
|
+
const response = await got({
|
|
17
|
+
method: 'get',
|
|
18
|
+
url: rootUrl,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const $ = cheerio.load(response.data);
|
|
22
|
+
const list = $('*:is(.pcBox .caItem, .mainList li a div) h2')
|
|
23
|
+
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 10)
|
|
24
|
+
.toArray()
|
|
25
|
+
.map((item) => {
|
|
26
|
+
item = $(item);
|
|
27
|
+
return {
|
|
28
|
+
title: item.text(),
|
|
29
|
+
link: item.parents('a').attr('href'),
|
|
30
|
+
pubDate: timezone(parseDate(item.next().text()), +8),
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const items = await Promise.all(
|
|
35
|
+
list.map((item) =>
|
|
36
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
37
|
+
const detailResponse = await got({
|
|
38
|
+
method: 'get',
|
|
39
|
+
url: item.link,
|
|
40
|
+
});
|
|
41
|
+
const content = cheerio.load(detailResponse.data);
|
|
42
|
+
const topImage = content('.fullPic').html();
|
|
43
|
+
|
|
44
|
+
item.description = (topImage === null ? '' : topImage) + content('.paragraph').eq(0).html();
|
|
45
|
+
item.category = [
|
|
46
|
+
...content("meta[property='article:tag']")
|
|
47
|
+
.get()
|
|
48
|
+
.map((e) => e.attribs.content),
|
|
49
|
+
content('.active > a').text(),
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
return item;
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
ctx.state.data = {
|
|
58
|
+
title: $('title').text(),
|
|
59
|
+
link: rootUrl,
|
|
60
|
+
item: items,
|
|
61
|
+
};
|
|
62
|
+
};
|
package/lib/v2/cste/radar.js
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
title: '栏目',
|
|
7
7
|
docs: 'https://docs.rsshub.app/routes/study#zhong-guo-ji-shu-jing-ji-xue-hui-lan-mu',
|
|
8
8
|
source: ['/site/term', '/'],
|
|
9
|
-
target: (params, url) => `/cste/${
|
|
9
|
+
target: (params, url) => `/cste/${url.match(/site\/term\/(\d+)\.html/)[1]}`,
|
|
10
10
|
},
|
|
11
11
|
],
|
|
12
12
|
},
|
package/lib/v2/dahecube/radar.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const utils = require('./utils');
|
|
2
|
-
|
|
3
1
|
module.exports = {
|
|
4
2
|
'dahecube.com': {
|
|
5
3
|
_name: '大河财立方',
|
|
@@ -9,9 +7,47 @@ module.exports = {
|
|
|
9
7
|
docs: 'https://docs.rsshub.app/routes/new-media#da-he-cai-li-fang',
|
|
10
8
|
source: ['/channel.html', '/index.html'],
|
|
11
9
|
target: (_, url) => {
|
|
12
|
-
const id = new URL(url).searchParams.get('recid');
|
|
10
|
+
const id = parseInt(new URL(url).searchParams.get('recid'));
|
|
13
11
|
let type = 'recommend';
|
|
14
|
-
|
|
12
|
+
const TypeMap = {
|
|
13
|
+
recommend: {
|
|
14
|
+
name: '推荐',
|
|
15
|
+
id: 1,
|
|
16
|
+
},
|
|
17
|
+
history: {
|
|
18
|
+
name: '党史',
|
|
19
|
+
id: 37,
|
|
20
|
+
},
|
|
21
|
+
stock: {
|
|
22
|
+
name: '豫股',
|
|
23
|
+
id: 2,
|
|
24
|
+
},
|
|
25
|
+
business: {
|
|
26
|
+
name: '财经',
|
|
27
|
+
id: 4,
|
|
28
|
+
},
|
|
29
|
+
education: {
|
|
30
|
+
name: '投教',
|
|
31
|
+
id: 36,
|
|
32
|
+
},
|
|
33
|
+
finance: {
|
|
34
|
+
name: '金融',
|
|
35
|
+
id: 5,
|
|
36
|
+
},
|
|
37
|
+
science: {
|
|
38
|
+
name: '科创',
|
|
39
|
+
id: 19,
|
|
40
|
+
},
|
|
41
|
+
invest: {
|
|
42
|
+
name: '投融',
|
|
43
|
+
id: 29,
|
|
44
|
+
},
|
|
45
|
+
column: {
|
|
46
|
+
name: '专栏',
|
|
47
|
+
id: 33,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
Object.entries(TypeMap).forEach(([key, value]) => {
|
|
15
51
|
if (value.id === id) {
|
|
16
52
|
type = key;
|
|
17
53
|
}
|
|
@@ -42,7 +42,7 @@ const ProcessVideo = (content) => {
|
|
|
42
42
|
const ProcessHref = (content) => {
|
|
43
43
|
content.each((j, y) => {
|
|
44
44
|
if (y.attribs.href) {
|
|
45
|
-
y.attribs.href = y.attribs.href.replace('dongqiudi:///news', 'https://www.dongqiudi.com/
|
|
45
|
+
y.attribs.href = y.attribs.href.replace('dongqiudi:///news', 'https://www.dongqiudi.com/article');
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
};
|