Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relekang/graphql-rss-parser
A microservice that parses rss feeds and makes it available as grahpql service.
https://github.com/relekang/graphql-rss-parser
graphql graphql-server jsonfeed jsonfeed-reader micro microservice rss rss-parser
Last synced: 2 months ago
JSON representation
A microservice that parses rss feeds and makes it available as grahpql service.
- Host: GitHub
- URL: https://github.com/relekang/graphql-rss-parser
- Owner: relekang
- License: mit
- Created: 2017-04-28T05:19:53.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-04-14T10:55:06.000Z (over 1 year ago)
- Last Synced: 2024-04-18T12:30:44.392Z (8 months ago)
- Topics: graphql, graphql-server, jsonfeed, jsonfeed-reader, micro, microservice, rss, rss-parser
- Language: TypeScript
- Homepage:
- Size: 2.71 MB
- Stars: 72
- Watchers: 3
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license
Awesome Lists containing this project
- awesome-list-microservice - micro-rss-parser
README
graphql-rss-parser
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.## Installation
```shell
npm i -g graphql-rss-parser
```## Usage
### CLI for starting the server
```shell
$ graphql-rss-parser --helpUsage: 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 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
```### Sentry integration
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.### Example queries
#### feed(url: String, [parser: Parser])
```graphql
{
feed(url: "https://rolflekang.com/feed.xml") {
title
entries {
title
pubDate
link
}
}
}
```##### Specifying the parser.
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` - [feedparser][]
* `RSS_PARSER` - [rss-parser][]
* `FEEDME` - [feedme][]
* `RSS_TO_JSON` - [rss-to-json][]
* `JSON_FEED_V1` - internal see `src/parsers/jsonfeed-v1.ts````graphql
{
feed(url: "https://rolflekang.com/feed.xml", parser: FEEDPARSER) {
entries {
link
}
}
}
```#### findFeed(url: String)
```graphql
{
findFeed(url: "https://rolflekang.com") {
link
}
}
```[graphql]: http://graphql.org/
[feedparser]: https://www.npmjs.com/package/feedparser
[rss-parser]: https://www.npmjs.com/package/rss-parser
[feedme]: https://www.npmjs.com/package/feedme
[rss-to-json]: https://www.npmjs.com/package/rss-to-json