diff --git a/docs/README.md b/docs/README.md index 6a9752cef..eb9df8cf5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2684,9 +2684,3 @@ ISO 3166-1 国家代码列表请参见 [维基百科 ISO_3166-1](https://zh.wiki 路由: `/xkcd/comic` 参数: 无 - -#### what-if - -举例: - -路由: `/xkcd/what-if` diff --git a/routes/xkcd/what-if.js b/routes/xkcd/what-if.js deleted file mode 100644 index d40a4c82f..000000000 --- a/routes/xkcd/what-if.js +++ /dev/null @@ -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(), - }; -};