MCPcopy Create free account
hub / github.com/bxcodec/github-readme-medium-recent-article / feedToJSON

Function feedToJSON

app/util/feedtojson.ts:4–16  ·  view source on GitHub ↗
(rssUrl: string)

Source from the content-addressed store, hash-verified

2import { getRandomUserAgent } from './useragent'
3
4export 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}

Callers 1

getArticleFunction · 0.90

Calls 1

getRandomUserAgentFunction · 0.90

Tested by

no test coverage detected