mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
feat: nogizaka46 official website (#2710)
Co-authored-by: DIYgod <diy.d.god@gmail.com>
This commit is contained in:
@@ -689,6 +689,12 @@ type 为 all 时,category 参数不支持 cost 和 free
|
|||||||
|
|
||||||
<Route author="howel52" example="/jpmorganchase" path="/jpmorganchase"/>
|
<Route author="howel52" example="/jpmorganchase" path="/jpmorganchase"/>
|
||||||
|
|
||||||
|
## 乃木坂 46 官网
|
||||||
|
|
||||||
|
### 新闻
|
||||||
|
|
||||||
|
<Route author="crispgm" example="/nogizaka46/news" path="/nogizaka46/news" />
|
||||||
|
|
||||||
## 派代
|
## 派代
|
||||||
|
|
||||||
### 首页
|
### 首页
|
||||||
|
|||||||
@@ -1583,6 +1583,9 @@ router.get('/yidoutang/case/:type', require('./routes/yidoutang/case.js'));
|
|||||||
// 开眼
|
// 开眼
|
||||||
router.get('/kaiyan/index', require('./routes/kaiyan/index'));
|
router.get('/kaiyan/index', require('./routes/kaiyan/index'));
|
||||||
|
|
||||||
|
// 乃木坂46官网
|
||||||
|
router.get('/nogizaka46/news', require('./routes/nogizaka46/news'));
|
||||||
|
|
||||||
// 阿里云
|
// 阿里云
|
||||||
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
||||||
|
|
||||||
|
|||||||
50
lib/routes/nogizaka46/news.js
Normal file
50
lib/routes/nogizaka46/news.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: 'http://www.nogizaka46.com/news/',
|
||||||
|
headers: {
|
||||||
|
Referer: 'http://www.nogizaka46.com/',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const list = $('#news #sheet div.left div.padding ul li');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
allowEmpty: true,
|
||||||
|
title: '乃木坂46官网 NEWS',
|
||||||
|
link: 'http://www.nogizaka46.com/news/',
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
console.log(
|
||||||
|
item
|
||||||
|
.find('.title strong a')
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
title: item
|
||||||
|
.find('.title strong a')
|
||||||
|
.first()
|
||||||
|
.text(),
|
||||||
|
description: item
|
||||||
|
.find('.summary')
|
||||||
|
.first()
|
||||||
|
.text(),
|
||||||
|
link: item.find('.title strong a').attr('href'),
|
||||||
|
pubDate: item
|
||||||
|
.find('.date')
|
||||||
|
.first()
|
||||||
|
.text(),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user