mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): add foreverblog (#8455)
Co-authored-by: DIYgod <diy.d.god@gmail.com>
This commit is contained in:
@@ -1328,4 +1328,13 @@
|
||||
},
|
||||
'macwk.com': { _name: 'MacWk', '.': [{ title: '应用更新', docs: 'https://docs.rsshub.app/program-update.html#macwk', source: '/soft/:name', target: '/macwk/soft/:name' }] },
|
||||
'zyshow.net': { www: [{ title: '', docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di', source: '/:name/', target: '/zyshow/:name' }] },
|
||||
'foreverblog.cn': {
|
||||
_name: 'foreverblog',
|
||||
www: [
|
||||
{
|
||||
title: '十年之约',
|
||||
docs: 'https://docs.rsshub.app/social-media.html#foreverblog',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -205,3 +205,9 @@ pageClass: routes
|
||||
### 文章
|
||||
|
||||
<Route author="junbaor SkiTiSu" example="/blogs/wangyin" path="/blogs/wangyin"/>
|
||||
|
||||
## 十年之约
|
||||
|
||||
### 文章
|
||||
|
||||
<Route author="7Wate" example="/blogs/foreverblog" path="/blogs/foreverblog" />
|
||||
|
||||
@@ -4230,6 +4230,9 @@ router.get('/now/news/rank', lazyloadRouteHandler('./routes/now/rank'));
|
||||
// s-hentai
|
||||
router.get('/s-hentai/:id?', lazyloadRouteHandler('./routes/s-hentai'));
|
||||
|
||||
// foreverblog
|
||||
router.get('/blogs/foreverblog', lazyloadRouteHandler('./routes/blogs/foreverblog'));
|
||||
|
||||
// Netflix
|
||||
router.get('/netflix/newsroom/:category?/:region?', lazyloadRouteHandler('./routes/netflix/newsroom'));
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://www.foreverblog.cn/feeds.html',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('article[class="post post-type-normal"]');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '十年之约 - 订阅',
|
||||
link: 'https://www.foreverblog.cn/feeds.html',
|
||||
language: 'zh-cn',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a.post-title-link>span').text(),
|
||||
description: item.find('div.post-author').text(),
|
||||
link: item.find('a.post-title-link').attr('href'),
|
||||
pubDate: item.find('time.post-time').text(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user