rss: remove xkcd what-if

This commit is contained in:
DIYgod
2018-09-04 22:54:01 +08:00
parent ec39bfb29b
commit 734b6a8ecf
2 changed files with 0 additions and 43 deletions
-6
View File
@@ -2684,9 +2684,3 @@ ISO 3166-1 国家代码列表请参见 [维基百科 ISO_3166-1](https://zh.wiki
路由: `/xkcd/comic`
参数: 无
#### what-if <Author uid="arbent"/>
举例: <https://rsshub.app/xkcd/what-if>
路由: `/xkcd/what-if`
-37
View File
@@ -1,37 +0,0 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://what-if.xkcd.com/feed.atom',
headers: {
Referer: 'https://xkcd.com/',
},
});
const data = response.data;
const $ = cheerio.load(data, {
xmlMode: true,
});
const list = $('entry');
ctx.state.data = {
title: 'what-if',
link: 'https://what-if.xkcd.com/',
description: "xkcd' article",
item:
list &&
list
.map((index, item) => {
item = $(item);
return {
title: item.find('title').text(),
description: item.find('content').text(),
pubDate: item.find('updated').text(),
link: item.find('id').text(),
};
})
.get(),
};
};