@@ -2,7 +2,7 @@ import { load } from 'cheerio';
22
33import type { DataItem , Route } from '@/types' ;
44import cache from '@/utils/cache' ;
5- import got from '@/utils/got ' ;
5+ import ofetch from '@/utils/ofetch ' ;
66import { parseDate } from '@/utils/parse-date' ;
77import parser from '@/utils/rss-parser' ;
88
@@ -17,7 +17,7 @@ export const route: Route = {
1717 ] ,
1818 url : 'baoyu.io/' ,
1919 name : 'Blog' ,
20- maintainers : [ 'liyaozhong' ] ,
20+ maintainers : [ 'liyaozhong' , 'Circloud' ] ,
2121 handler,
2222 description : '宝玉 - 博客文章' ,
2323} ;
@@ -26,15 +26,16 @@ async function handler() {
2626 const rootUrl = 'https://baoyu.io' ;
2727 const feedUrl = `${ rootUrl } /feed.xml` ;
2828
29- const feed = await parser . parseURL ( feedUrl ) ;
29+ const response = await ofetch ( feedUrl ) ;
30+ const feed = await parser . parseString ( response ) ;
3031
3132 const items = await Promise . all (
3233 feed . items . map ( ( item ) => {
3334 const link = item . link ;
3435
3536 return cache . tryGet ( link as string , async ( ) => {
36- const response = await got ( link ) ;
37- const $ = load ( response . data ) ;
37+ const response = await ofetch ( link as string ) ;
38+ const $ = load ( response ) ;
3839
3940 const container = $ ( '.container' ) ;
4041 const content = container . find ( '.prose' ) . html ( ) || '' ;
0 commit comments