Skip to content

Commit 8e96fa1

Browse files
authored
Merge pull request #622 from DIYgod/master
[pull] master from diygod:master
2 parents ef78d3b + d56dd71 commit 8e96fa1

File tree

9 files changed

+81
-62
lines changed

9 files changed

+81
-62
lines changed

docs/blog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ username 为博主用户名,而非`xxx.hashnode.dev`中`xxx`所代表的 blog
316316

317317
## 十年之约
318318

319-
### 文章
319+
### 专题展示 - 文章
320320

321-
<Route author="7Wate" example="/blogs/foreverblog" path="/blogs/foreverblog" />
321+
<Route author="7Wate a180285" example="/foreverblog/feeds" path="/foreverblog/feeds" radar="1" rssbud="1" />
322322

323323
## 王五四文集
324324

lib/routes/blogs/foreverblog.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/v2/foreverblog/feeds.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 currentUrl = 'https://www.foreverblog.cn/feeds.html';
8+
9+
const response = await got(currentUrl);
10+
11+
const $ = cheerio.load(response.data);
12+
const $articles = $('article[class="post post-type-normal"]');
13+
const items = $articles
14+
.map((_, el) => {
15+
const $titleDiv = $(el).find('h1[class="post-title"]');
16+
const title = $titleDiv.text().trim();
17+
const link = $titleDiv.find('a').eq(0).attr('href');
18+
const author = $(el).find('div[class="post-author"]').text().trim();
19+
const postDate = $(el).find('time').text().trim();
20+
const pubDate = timezone(parseDate(postDate, 'MM-DD'), +8);
21+
const description = `${author}: ${title}`;
22+
return {
23+
title: description,
24+
description,
25+
link,
26+
pubDate,
27+
};
28+
})
29+
.toArray();
30+
31+
ctx.state.data = {
32+
title: '十年之约——专题展示',
33+
link: currentUrl,
34+
item: items,
35+
};
36+
};

lib/v2/foreverblog/maintainer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'/feeds': ['7Wate', 'a180285'],
3+
};

lib/v2/foreverblog/radar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
'foreverblog.cn': {
3+
_name: '十年之约',
4+
www: [
5+
{
6+
title: '专题展示',
7+
docs: 'https://docs.rsshub.app/blog.html#shi-nian-zhi-yue',
8+
source: ['/feeds.html'],
9+
target: '/foreverblog/feeds',
10+
},
11+
],
12+
},
13+
};

lib/v2/foreverblog/router.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function (router) {
2+
router.get('/feeds', require('./feeds'));
3+
};

lib/v2/mihoyo/ys/news.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ const titles = {
4343
module.exports = async (ctx) => {
4444
const location = ctx.params.location ?? 'main';
4545
const category = ctx.params.category ?? 'latest';
46+
const limit = ctx.query.limit ? Number(ctx.query.limit) : 30;
4647

4748
const is_zh_CN = location === 'main';
4849

4950
const rootUrl = is_zh_CN
50-
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize=5&pageNum=1&channelId=${config[category][location]}`
51-
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize=5&pageNum=1&channelId=${config[category][location]}`;
51+
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`
52+
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`;
5253

5354
const response = await got(rootUrl);
5455

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"devDependencies": {
5151
"@napi-rs/pinyin": "1.7.1",
5252
"@types/koa": "2.13.5",
53-
"@vercel/nft": "0.22.1",
53+
"@vercel/nft": "0.22.5",
5454
"@vuepress/plugin-back-to-top": "1.9.7",
5555
"@vuepress/plugin-google-analytics": "1.9.7",
5656
"@vuepress/plugin-pwa": "1.9.7",
@@ -100,7 +100,7 @@
100100
"city-timezones": "1.2.1",
101101
"crypto-js": "4.1.1",
102102
"currency-symbol-map": "5.1.0",
103-
"dayjs": "1.11.6",
103+
"dayjs": "1.11.7",
104104
"dotenv": "16.0.3",
105105
"emailjs-imap-client": "3.1.0",
106106
"entities": "3.0.1",

yarn.lock

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,14 @@
15301530
dependencies:
15311531
safe-buffer "^5.0.1"
15321532

1533+
"@rollup/pluginutils@^4.0.0":
1534+
version "4.2.1"
1535+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
1536+
integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==
1537+
dependencies:
1538+
estree-walker "^2.0.1"
1539+
picomatch "^2.2.2"
1540+
15331541
"@selderee/plugin-htmlparser2@^0.6.0":
15341542
version "0.6.0"
15351543
resolved "https://registry.yarnpkg.com/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz#27e994afd1c2cb647ceb5406a185a5574188069d"
@@ -2052,12 +2060,13 @@
20522060
dependencies:
20532061
"@types/node" "*"
20542062

2055-
"@vercel/nft@0.22.1":
2056-
version "0.22.1"
2057-
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.22.1.tgz#0d91d2a21e3a7f0b23ce1550da9870eac4942828"
2058-
integrity sha512-lYYZIoxRurqDOSoVIdBicGnpUIpfyaS5qVjdPq+EfI285WqtZK3NK/dyCkiyBul+X2U2OEhRyeMdXPCHGJbohw==
2063+
"@vercel/nft@0.22.5":
2064+
version "0.22.5"
2065+
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.22.5.tgz#951bd7589ceebdd3e280afcf3a13bdacf83f6b7e"
2066+
integrity sha512-mug57Wd1BL7GMj9gXMgMeKUjdqO0e4u+0QLPYMFE1rwdJ+55oPy6lp3nIBCS8gOvigT62UI4QKUL2sGqcoW4Hw==
20592067
dependencies:
20602068
"@mapbox/node-pre-gyp" "^1.0.5"
2069+
"@rollup/pluginutils" "^4.0.0"
20612070
acorn "^8.6.0"
20622071
async-sema "^3.1.1"
20632072
bindings "^1.4.0"
@@ -2067,7 +2076,6 @@
20672076
micromatch "^4.0.2"
20682077
node-gyp-build "^4.2.2"
20692078
resolve-from "^5.0.0"
2070-
rollup-pluginutils "^2.8.2"
20712079

20722080
"@vue/babel-helper-vue-jsx-merge-props@^1.4.0":
20732081
version "1.4.0"
@@ -4676,10 +4684,10 @@ data-urls@^3.0.2:
46764684
whatwg-mimetype "^3.0.0"
46774685
whatwg-url "^11.0.0"
46784686

4679-
dayjs@1.11.6, dayjs@^1.10.0:
4680-
version "1.11.6"
4681-
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb"
4682-
integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==
4687+
dayjs@1.11.7, dayjs@^1.10.0:
4688+
version "1.11.7"
4689+
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
4690+
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
46834691

46844692
de-indent@^1.0.2:
46854693
version "1.0.2"
@@ -5759,16 +5767,11 @@ estraverse@^5.1.0, estraverse@^5.2.0:
57595767
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
57605768
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
57615769

5762-
estree-walker@2.0.2:
5770+
estree-walker@2.0.2, estree-walker@^2.0.1:
57635771
version "2.0.2"
57645772
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
57655773
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
57665774

5767-
estree-walker@^0.6.1:
5768-
version "0.6.1"
5769-
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362"
5770-
integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==
5771-
57725775
esutils@^2.0.2:
57735776
version "2.0.3"
57745777
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
@@ -10726,7 +10729,7 @@ picocolors@^1.0.0:
1072610729
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
1072710730
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
1072810731

10729-
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
10732+
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1:
1073010733
version "2.3.1"
1073110734
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
1073210735
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
@@ -12094,13 +12097,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
1209412097
hash-base "^3.0.0"
1209512098
inherits "^2.0.1"
1209612099

12097-
rollup-pluginutils@^2.8.2:
12098-
version "2.8.2"
12099-
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
12100-
integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==
12101-
dependencies:
12102-
estree-walker "^0.6.1"
12103-
1210412100
rss-parser@3.12.0:
1210512101
version "3.12.0"
1210612102
resolved "https://registry.yarnpkg.com/rss-parser/-/rss-parser-3.12.0.tgz#b8888699ea46304a74363fbd8144671b2997984c"

0 commit comments

Comments
 (0)