mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 23:34:38 +08:00
feat: add keyakizaka and hinatazaka blog (#4245)
This commit is contained in:
@@ -297,20 +297,28 @@ Supported sub-sites:
|
|||||||
|
|
||||||
<Route author="jeffcottLu" example="/baijing" path="/baijing"></Route>
|
<Route author="jeffcottLu" example="/baijing" path="/baijing"></Route>
|
||||||
|
|
||||||
## 坂道系列官网新闻
|
## 坂道系列官网资讯
|
||||||
|
|
||||||
### 乃木坂 46
|
### 乃木坂 46 新闻
|
||||||
|
|
||||||
<Route author="crispgm" example="/nogizaka46/news" path="/nogizaka46/news" />
|
<Route author="crispgm" example="/nogizaka46/news" path="/nogizaka46/news" />
|
||||||
|
|
||||||
### 欅坂 46
|
### 欅坂 46 新闻
|
||||||
|
|
||||||
<Route author="crispgm" example="/keyakizaka46/news" path="/keyakizaka46/news" />
|
<Route author="crispgm" example="/keyakizaka46/news" path="/keyakizaka46/news" />
|
||||||
|
|
||||||
### 日向坂 46
|
### 欅坂 46 博客
|
||||||
|
|
||||||
|
<Route author="nwindz" example="/keyakizaka46/blog" path="/keyakizaka46/blog" />
|
||||||
|
|
||||||
|
### 日向坂 46 新闻
|
||||||
|
|
||||||
<Route author="crispgm" example="/hinatazaka46/news" path="/hinatazaka46/news" />
|
<Route author="crispgm" example="/hinatazaka46/news" path="/hinatazaka46/news" />
|
||||||
|
|
||||||
|
### 日向坂 46 博客
|
||||||
|
|
||||||
|
<Route author="nwindz" example="/hinatazaka46/blog" path="/hinatazaka46/blog" />
|
||||||
|
|
||||||
## 币世界
|
## 币世界
|
||||||
|
|
||||||
### 快讯
|
### 快讯
|
||||||
|
|||||||
@@ -1764,10 +1764,12 @@ router.get('/lkong/forum/:id/:digest?', require('./routes/lkong/forum'));
|
|||||||
router.get('/lkong/thread/:id', require('./routes/lkong/thread'));
|
router.get('/lkong/thread/:id', require('./routes/lkong/thread'));
|
||||||
// router.get('/lkong/user/:id', require('./routes/lkong/user'));
|
// router.get('/lkong/user/:id', require('./routes/lkong/user'));
|
||||||
|
|
||||||
// 坂道系列官网新闻
|
// 坂道系列资讯
|
||||||
router.get('/nogizaka46/news', require('./routes/nogizaka46/news'));
|
router.get('/nogizaka46/news', require('./routes/nogizaka46/news'));
|
||||||
router.get('/keyakizaka46/news', require('./routes/keyakizaka46/news'));
|
router.get('/keyakizaka46/news', require('./routes/keyakizaka46/news'));
|
||||||
|
router.get('/keyakizaka46/blog', require('./routes/keyakizaka46/blog'));
|
||||||
router.get('/hinatazaka46/news', require('./routes/hinatazaka46/news'));
|
router.get('/hinatazaka46/news', require('./routes/hinatazaka46/news'));
|
||||||
|
router.get('/hinatazaka46/blog', require('./routes/hinatazaka46/blog'));
|
||||||
|
|
||||||
// 阿里云
|
// 阿里云
|
||||||
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
||||||
|
|||||||
47
lib/routes/hinatazaka46/blog.js
Normal file
47
lib/routes/hinatazaka46/blog.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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/diary/member',
|
||||||
|
headers: {
|
||||||
|
Referer: 'http://www.hinatazaka46.com/',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const list = $('div.p-blog-top__contents ul li');
|
||||||
|
let itemPicUrl;
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
allowEmpty: true,
|
||||||
|
title: '日向坂46官网 博客',
|
||||||
|
link: 'https://www.hinatazaka46.com/s/official/diary/member',
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
itemPicUrl = `${item.find('div.c-blog__image').attr('style')}`.replace('background-image:url(', '').replace(');', '');
|
||||||
|
return {
|
||||||
|
title: item
|
||||||
|
.find('p.c-blog-top__title')
|
||||||
|
.text()
|
||||||
|
.trim(),
|
||||||
|
link: item
|
||||||
|
.find('a')
|
||||||
|
.first()
|
||||||
|
.attr('href'),
|
||||||
|
pubDate: item.find('time.c-blog-top__date').text(),
|
||||||
|
author: item
|
||||||
|
.find('div.c-blog-top__name')
|
||||||
|
.text()
|
||||||
|
.trim(),
|
||||||
|
description: `<img src="${itemPicUrl}">`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
48
lib/routes/keyakizaka46/blog.js
Normal file
48
lib/routes/keyakizaka46/blog.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
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/diary/member',
|
||||||
|
headers: {
|
||||||
|
Referer: 'http://www.keyakizaka46.com/',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const list = $('div.box-newposts div.slider ul li');
|
||||||
|
let itemPicUrl;
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
allowEmpty: true,
|
||||||
|
title: '欅坂46官网 博客',
|
||||||
|
link: 'https://www.keyakizaka46.com/s/k46o/diary/member',
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
itemPicUrl = `${item.find('img.js-replaceImage').attr('src')}`;
|
||||||
|
return {
|
||||||
|
title: item
|
||||||
|
.find('p.ttl')
|
||||||
|
.text()
|
||||||
|
.trim(),
|
||||||
|
link: item
|
||||||
|
.find('a')
|
||||||
|
.first()
|
||||||
|
.attr('href'),
|
||||||
|
pubDate: item.find('div.box-blog time').text(),
|
||||||
|
author: item
|
||||||
|
.find('p.ttl')
|
||||||
|
.next()
|
||||||
|
.text()
|
||||||
|
.trim(),
|
||||||
|
description: `<img src="${itemPicUrl}">`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user