(rssUrl: string)
| 2 | import { getRandomUserAgent } from './useragent' |
| 3 | |
| 4 | export const feedToJSON = async (rssUrl: string) => { |
| 5 | try { |
| 6 | const feed = await parse(rssUrl, { |
| 7 | headers: { |
| 8 | 'User-Agent': getRandomUserAgent(), |
| 9 | } |
| 10 | }) |
| 11 | return feed |
| 12 | } catch (error) { |
| 13 | console.error('error parsing RSS', error) |
| 14 | return null |
| 15 | } |
| 16 | } |
no test coverage detected