fix a9vg feed (#1935)

修复a9vg feed
This commit is contained in:
xu yang
2019-04-17 11:57:39 +08:00
committed by DIYgod
parent c1b177e2da
commit 61547c4f3c
+8 -8
View File
@@ -4,20 +4,20 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'http://www.a9vg.com/news/',
url: 'http://www.a9vg.com/list/news',
headers: {
Referer: 'http://www.a9vg.com/news/',
Referer: 'http://www.a9vg.com/list/news',
},
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.txt-r-img.combine2 dl');
const list = $('.a9-rich-card-list li');
ctx.state.data = {
title: 'A9VG电玩部落',
link: 'http://www.a9vg.com/news/',
link: 'http://www.a9vg.com/list/news/',
description: '电玩资讯_电玩动态- A9VG电玩部落',
item:
list &&
@@ -25,10 +25,10 @@ module.exports = async (ctx) => {
.map((index, item) => {
item = $(item);
return {
title: item.find('.img-scale').attr('title'),
description: item.find('p').text() + '<img referrerpolicy="no-referrer" src="' + item.find('img').attr('src') + '">',
pubDate: new Date(item.find('.time').text()).toUTCString(),
link: item.find('.img-scale').attr('href'),
title: item.find('.a9-rich-card-list_label').text(),
description: item.find('.a9-rich-card-list_summary').text() + '<img src="' + item.find('img').attr('src') + '">',
pubDate: new Date(item.find('.a9-rich-card-list_infos').text()).toUTCString(),
link: 'http://www.a9vg.com' + item.find('.a9-rich-card-list_item').attr('href'),
};
})
.get(),