mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 21:18:57 +08:00
fix(route): yystv change selector path, add radar and refactor to V2 (#9529)
* fix(route): change selector path, add radar and refactor to V2 * fix: use parse-date utils * fix: use https
This commit is contained in:
@@ -1456,8 +1456,8 @@ router.get('/gamersky/news', lazyloadRouteHandler('./routes/gamersky/news'));
|
|||||||
router.get('/gamersky/ent/:category', lazyloadRouteHandler('./routes/gamersky/ent'));
|
router.get('/gamersky/ent/:category', lazyloadRouteHandler('./routes/gamersky/ent'));
|
||||||
|
|
||||||
// 游研社
|
// 游研社
|
||||||
router.get('/yystv/category/:category', lazyloadRouteHandler('./routes/yystv/category'));
|
// router.get('/yystv/category/:category', lazyloadRouteHandler('./routes/yystv/category'));
|
||||||
router.get('/yystv/docs', lazyloadRouteHandler('./routes/yystv/docs'));
|
// router.get('/yystv/docs', lazyloadRouteHandler('./routes/yystv/docs'));
|
||||||
|
|
||||||
// konami
|
// konami
|
||||||
router.get('/konami/pesmobile/:lang?/:os?', lazyloadRouteHandler('./routes/konami/pesmobile'));
|
router.get('/konami/pesmobile/:lang?/:os?', lazyloadRouteHandler('./routes/konami/pesmobile'));
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
const got = require('@/utils/got');
|
const got = require('@/utils/got');
|
||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const date = require('@/utils/date');
|
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
module.exports = async (ctx) => {
|
||||||
const category = ctx.params.category;
|
const category = ctx.params.category;
|
||||||
const url = `http://www.yystv.cn/b/${category}`;
|
const url = `https://www.yystv.cn/b/${category}`;
|
||||||
const response = await got({
|
const response = await got({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url,
|
url,
|
||||||
@@ -18,8 +18,8 @@ module.exports = async (ctx) => {
|
|||||||
.map(function () {
|
.map(function () {
|
||||||
const info = {
|
const info = {
|
||||||
title: $(this).find('.b-main-info-title').text(),
|
title: $(this).find('.b-main-info-title').text(),
|
||||||
link: 'http://www.yystv.cn' + $(this).find('.b-main-info-title a').attr('href'),
|
link: 'https://www.yystv.cn' + $(this).find('.b-main-info-title a').attr('href'),
|
||||||
pubDate: date($(this).find('.b-main-createtime').text()),
|
pubDate: parseRelativeDate($(this).find('.b-main-createtime').text()),
|
||||||
author: $(this).find('.b-author').text(),
|
author: $(this).find('.b-author').text(),
|
||||||
};
|
};
|
||||||
return info;
|
return info;
|
||||||
@@ -31,8 +31,8 @@ module.exports = async (ctx) => {
|
|||||||
.map(function () {
|
.map(function () {
|
||||||
const info = {
|
const info = {
|
||||||
title: $('.list-article-title', this).text(),
|
title: $('.list-article-title', this).text(),
|
||||||
link: 'http://www.yystv.cn' + $('a', this).attr('href'),
|
link: 'https://www.yystv.cn' + $('a', this).attr('href'),
|
||||||
pubDate: date($('.c-999', this).text()),
|
pubDate: $('.c-999', this).text().includes('-') ? parseDate($('.c-999', this).text()) : parseRelativeDate($('.c-999', this).text()),
|
||||||
author: $('.handler-author-link', this).text(),
|
author: $('.handler-author-link', this).text(),
|
||||||
};
|
};
|
||||||
return info;
|
return info;
|
||||||
@@ -49,7 +49,7 @@ module.exports = async (ctx) => {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(r.data);
|
const $ = cheerio.load(r.data);
|
||||||
return $('.doc-content div').html();
|
return $('.doc-content.rel').html();
|
||||||
});
|
});
|
||||||
return currentValue;
|
return currentValue;
|
||||||
})
|
})
|
||||||
@@ -58,7 +58,7 @@ module.exports = async (ctx) => {
|
|||||||
await getDescription(items).then(() => {
|
await getDescription(items).then(() => {
|
||||||
ctx.state.data = {
|
ctx.state.data = {
|
||||||
title: '游研社-' + $('title').text(),
|
title: '游研社-' + $('title').text(),
|
||||||
link: `http://www.yystv.cn/b/${category}`,
|
link: `https://www.yystv.cn/b/${category}`,
|
||||||
item: items,
|
item: items,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
const got = require('@/utils/got');
|
const got = require('@/utils/got');
|
||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const date = require('@/utils/date');
|
const { parseRelativeDate } = require('@/utils/parse-date');
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
module.exports = async (ctx) => {
|
||||||
const url = `https://www.yystv.cn/docs`;
|
const url = `https://www.yystv.cn/docs`;
|
||||||
@@ -18,7 +18,7 @@ module.exports = async (ctx) => {
|
|||||||
const info = {
|
const info = {
|
||||||
title: $('.list-article-title', this).text(),
|
title: $('.list-article-title', this).text(),
|
||||||
link: 'https://www.yystv.cn' + $('a', this).attr('href'),
|
link: 'https://www.yystv.cn' + $('a', this).attr('href'),
|
||||||
pubDate: date($('.c-999', this).text()),
|
pubDate: parseRelativeDate($('.c-999', this).text()),
|
||||||
author: $('.handler-author-link', this).text(),
|
author: $('.handler-author-link', this).text(),
|
||||||
description: $('.list-article-intro', this).text(),
|
description: $('.list-article-intro', this).text(),
|
||||||
};
|
};
|
||||||
4
lib/v2/yystv/maintainer.js
Normal file
4
lib/v2/yystv/maintainer.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
'/category/:category': ['LightStrawberry'],
|
||||||
|
'/docs': ['HaitianLiu'],
|
||||||
|
};
|
||||||
49
lib/v2/yystv/radar.js
Normal file
49
lib/v2/yystv/radar.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
module.exports = {
|
||||||
|
'yystv.cn': {
|
||||||
|
_name: '游研社',
|
||||||
|
'.': [
|
||||||
|
{
|
||||||
|
title: '推游',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/recommend',
|
||||||
|
target: '/yystv/category/recommend',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '游戏史',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/history',
|
||||||
|
target: '/yystv/category/history',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '大事件',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/big',
|
||||||
|
target: '/yystv/category/big',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '文化',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/culture',
|
||||||
|
target: '/yystv/category/culture',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '趣闻',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/news',
|
||||||
|
target: '/yystv/category/news',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '经典回顾',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/b/retro',
|
||||||
|
target: '/yystv/category/retro',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '全部文章',
|
||||||
|
docs: 'https://docs.rsshub.app/game.html#you-yan-she',
|
||||||
|
source: '/docs',
|
||||||
|
target: '/yystv/docs',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
4
lib/v2/yystv/router.js
Normal file
4
lib/v2/yystv/router.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = function (router) {
|
||||||
|
router.get('/category/:category', require('./category'));
|
||||||
|
router.get('/docs', require('./docs'));
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user