mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 05:59:00 +08:00
@@ -2570,6 +2570,14 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
|
||||
|
||||
<route name="游戏时光游戏发售表" author="MyFaith" example="/vgtime/release" path="vgtime/release"/>
|
||||
|
||||
### 游民星空
|
||||
|
||||
<route name="游民星空今日推荐" author="LightStrawberry" example="/gamersky/news" path="/gamersky/news"/>
|
||||
|
||||
### 游研社
|
||||
|
||||
<route name="游研社推游" author="LightStrawberry" example="/yystv/recommend" path="/yystv/recommend"/>
|
||||
|
||||
## 小说·文学·阅读
|
||||
|
||||
### 观止(每日一文)
|
||||
|
||||
@@ -1174,4 +1174,10 @@ router.get('/zjgsu/tzgg', require('./routes/universities/zjgsu/tzgg/scripts'));
|
||||
router.get('/zjgsu/gsgg', require('./routes/universities/zjgsu/gsgg/scripts'));
|
||||
router.get('/zjgsu/xszq', require('./routes/universities/zjgsu/xszq/scripts'));
|
||||
|
||||
// gamersky
|
||||
router.get('/gamersky/news', require('./routes/gamersky/news'));
|
||||
|
||||
// 游研社
|
||||
router.get('/yystv/recommend/', require('./routes/yystv/recommend'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
44
lib/routes/gamersky/news.js
Normal file
44
lib/routes/gamersky/news.js
Normal file
@@ -0,0 +1,44 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://www.gamersky.com/news/',
|
||||
headers: {
|
||||
Referer: 'https://www.gamersky.com/news/',
|
||||
},
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
|
||||
const out = $('.Mid2L_con li')
|
||||
.slice(0, 10)
|
||||
.map(function() {
|
||||
const info = {
|
||||
title: $(this)
|
||||
.find('.tt')
|
||||
.text(),
|
||||
link: $(this)
|
||||
.find('.tt')
|
||||
.attr('href'),
|
||||
pubDate: new Date(
|
||||
$(this)
|
||||
.find('.time')
|
||||
.text()
|
||||
).toUTCString(),
|
||||
description: $(this)
|
||||
.find('.txt')
|
||||
.text(),
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '游民星空-今日推荐',
|
||||
link: 'https://www.gamersky.com/news/',
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
69
lib/routes/yystv/recommend.js
Normal file
69
lib/routes/yystv/recommend.js
Normal file
@@ -0,0 +1,69 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
const date = require('../../utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'http://www.yystv.cn/b/recommend',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
|
||||
const first_part = $('.b-list-main-item')
|
||||
.slice(0, 2)
|
||||
.map(function() {
|
||||
const info = {
|
||||
title: $(this)
|
||||
.find('.b-main-info-title')
|
||||
.text(),
|
||||
link:
|
||||
'http://www.yystv.cn' +
|
||||
$(this)
|
||||
.find('.b-main-info-title a')
|
||||
.attr('href'),
|
||||
pubDate: date(
|
||||
$(this)
|
||||
.find('.b-main-createtime')
|
||||
.text()
|
||||
),
|
||||
author: $(this)
|
||||
.find('.b-author')
|
||||
.text(),
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
const second_part = $('.b-list li')
|
||||
.slice(0, 8)
|
||||
.map(function() {
|
||||
const info = {
|
||||
title: $(this)
|
||||
.find('.b-item-title')
|
||||
.text(),
|
||||
link:
|
||||
'http://www.yystv.cn' +
|
||||
$(this)
|
||||
.find('.b-item-title a')
|
||||
.attr('href'),
|
||||
pubDate: date(
|
||||
$(this)
|
||||
.find('.fl')
|
||||
.text()
|
||||
),
|
||||
author: $(this)
|
||||
.find('.author-icon-list')
|
||||
.text(),
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '游研社-推游',
|
||||
link: 'http://www.yystv.cn/b/recommend',
|
||||
item: first_part.concat(second_part),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user