mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 07:12:51 +08:00
refactor: rename axios to got
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
const cheerio = require('cheerio');
|
||||
const axios = require('@/utils/axios');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = `http://${ctx.params.url}`;
|
||||
const res = await axios.get(`${url}/archives`);
|
||||
const res = await got.get(`${url}/archives`);
|
||||
const $ = cheerio.load(res.data);
|
||||
|
||||
const list = $('.post-header');
|
||||
@@ -26,7 +26,7 @@ module.exports = async (ctx) => {
|
||||
if (value) {
|
||||
item.description = value;
|
||||
} else {
|
||||
const storyDeatil = await axios.get(item.link);
|
||||
const storyDeatil = await got.get(item.link);
|
||||
const data = storyDeatil.data;
|
||||
const $ = cheerio.load(data);
|
||||
item.pubDate = $('time').attr('datetime');
|
||||
|
||||
Reference in New Issue
Block a user