feat: Add keyakizaka46 and hinatazaka46 (#3499)
This commit is contained in:
parent
9530e4c6f5
commit
a92da9021c
|
|
@ -224,6 +224,20 @@ pageClass: routes
|
|||
|
||||
<Route author="hillerliao" example="/8btc/news/flash" path="/8btc/news/flash"/>
|
||||
|
||||
## 坂道系列官网新闻
|
||||
|
||||
### 乃木坂 46
|
||||
|
||||
<Route author="crispgm" example="/nogizaka46/news" path="/nogizaka46/news" />
|
||||
|
||||
### 欅坂 46
|
||||
|
||||
<Route author="crispgm" example="/keyakizaka46/news" path="/keyakizaka46/news" />
|
||||
|
||||
### 日向坂 46
|
||||
|
||||
<Route author="crispgm" example="/hinatazaka46/news" path="/hinatazaka46/news" />
|
||||
|
||||
## 币世界
|
||||
|
||||
### 快讯
|
||||
|
|
@ -514,12 +528,6 @@ pageClass: routes
|
|||
|
||||
<Route author="howel52" example="/jpmorganchase" path="/jpmorganchase"/>
|
||||
|
||||
## 乃木坂 46 官网
|
||||
|
||||
### 新闻
|
||||
|
||||
<Route author="crispgm" example="/nogizaka46/news" path="/nogizaka46/news" />
|
||||
|
||||
## 派代
|
||||
|
||||
### 首页
|
||||
|
|
|
|||
|
|
@ -1687,8 +1687,10 @@ router.get('/lkong/forum/:id/:digest?', require('./routes/lkong/forum'));
|
|||
router.get('/lkong/thread/:id', require('./routes/lkong/thread'));
|
||||
// router.get('/lkong/user/:id', require('./routes/lkong/user'));
|
||||
|
||||
// 乃木坂46官网
|
||||
// 坂道系列官网新闻
|
||||
router.get('/nogizaka46/news', require('./routes/nogizaka46/news'));
|
||||
router.get('/keyakizaka46/news', require('./routes/keyakizaka46/news'));
|
||||
router.get('/hinatazaka46/news', require('./routes/hinatazaka46/news'));
|
||||
|
||||
// 阿里云
|
||||
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://www.hinatazaka46.com/s/official/news/list',
|
||||
headers: {
|
||||
Referer: 'http://www.hinatazaka46.com/',
|
||||
},
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('main div.l-maincontents--news ul.p-news__list li');
|
||||
|
||||
ctx.state.data = {
|
||||
allowEmpty: true,
|
||||
title: '日向坂46官网 NEWS',
|
||||
link: 'http://www.hinatazaka46.com/news/',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item
|
||||
.find('a p.c-news__text')
|
||||
.first()
|
||||
.text(),
|
||||
link: item.find('a').attr('href'),
|
||||
pubDate: item
|
||||
.find('a time.c-news__date')
|
||||
.first()
|
||||
.text(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://www.keyakizaka46.com/s/k46o/news/list',
|
||||
headers: {
|
||||
Referer: 'http://www.keyakizaka46.com/',
|
||||
},
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('div.keyaki-news div.box-news ul li');
|
||||
|
||||
ctx.state.data = {
|
||||
allowEmpty: true,
|
||||
title: '欅坂46官网 NEWS',
|
||||
link: 'http://www.keyakizaka46.com/news/',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item
|
||||
.find('div.text a')
|
||||
.first()
|
||||
.text(),
|
||||
link: item.find('div.text a').attr('href'),
|
||||
pubDate: item
|
||||
.find('div.date')
|
||||
.first()
|
||||
.text(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue