A graphql microservice that parses rss feeds and returns a JSON representation of the given feed. It uses different parses installed from npm. When a parser fail it will try the next following this order: feedparser, rss-parser, feedme, rss-to-json. To specify a specific parser see example queries below.
npm i -g graphql-rss-parser
$ graphql-rss-parser --help
Usage: graphql-rss-parser [options] [command]
Commands:
help Display help
Options:
-h, --help Output usage information
-H, --host [value] Host to listen on (defaults to "0.0.0.0")
-p, --port <n> Port to listen on (defaults to 3000)
-D, --sentry-dsn Sentry DSN. This is used to configure logging with sentry.io
-v, --version Output the version number
The sentry integration can be enabled by passing the -D/--sentry-dsn
cli option. It is important to note
that errors that happens because errors in parsers or http requests will be filtered out. This is because
the goal of this error tracking is to catch errors in the code of the service.
{
feed(url: "https://rolflekang.com/feed.xml") {
title
entries {
title
pubDate
link
}
}
}
graphql-rss-parser supports several of the rss parsers on npm. It can be specified with the parser option in a feed query as seen below.
Available parsers:
FEEDPARSER
- feedparserRSS_PARSER
- rss-parserFEEDME
- feedmeRSS_TO_JSON
- rss-to-jsonJSON_FEED_V1
- internal seesrc/parsers/jsonfeed-v1.ts
{
feed(url: "https://rolflekang.com/feed.xml", parser: FEEDPARSER) {
entries {
link
}
}
}
{
findFeed(url: "https://rolflekang.com") {
link
}
}