# micro-rss-parser

> A microservice that parses rss feeds and returns JSON

Latest version **2.1.0** (published 2020-05-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install micro-rss-parser
pnpm add micro-rss-parser
yarn add micro-rss-parser
bun add micro-rss-parser
```

Provides the command `micro-rss-parser`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2020-05-18 |
| First published | 2017-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 15 |
| Unpacked size | 31.9 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Rolf Erik Lekang |
| Maintainers | relekang |

## Links

- npm: https://www.npmjs.com/package/micro-rss-parser
- Repository: https://github.com/relekang/micro-rss-parser
- Homepage: https://github.com/relekang/micro-rss-parser#readme
- Issues: https://github.com/relekang/micro-rss-parser/issues
- npm.io page: https://npm.io/package/micro-rss-parser

## Dependencies (15)

- [args](https://npm.io/package/args.md) ^3.0.8
- [axios](https://npm.io/package/axios.md) ^0.19.2
- [micro](https://npm.io/package/micro.md) ^9.3.4
- [raven](https://npm.io/package/raven.md) ^2.6.4
- [feedme](https://npm.io/package/feedme.md) ^1.2.0
- [is-url](https://npm.io/package/is-url.md) ^1.2.4
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.3
- [graphql](https://npm.io/package/graphql.md) ^14.6.0
- [lodash-fp](https://npm.io/package/lodash-fp.md) ^0.10.4
- [rss-parser](https://npm.io/package/rss-parser.md) ^3.7.4
- [graphql-tools](https://npm.io/package/graphql-tools.md) ^4.0.6
- [normalize-url](https://npm.io/package/normalize-url.md) ^4.5.0
- [node-feedparser](https://npm.io/package/node-feedparser.md) ^1.0.1
- [update-notifier](https://npm.io/package/update-notifier.md) ^4.0.0
- [apollo-server-micro](https://npm.io/package/apollo-server-micro.md) ^2.9.16

## Recent versions

- 2.1.0 (latest) — 2020-05-18
- 2.0.0 — 2020-02-03
- 1.5.12 — 2018-02-23
- 1.5.11 — 2018-02-23
- 1.5.10 — 2018-02-23
- 1.5.9 — 2018-02-23
- 1.5.8 — 2017-12-17
- 1.5.7 — 2017-12-11
- 1.5.6 — 2017-12-10
- 1.5.5 — 2017-12-06
- 1.5.4 — 2017-12-02
- 1.5.3 — 2017-11-19
- 1.5.2 — 2017-11-17
- 1.5.1 — 2017-11-16
- 1.5.0 — 2017-11-08
- … 9 more at https://npm.io/package/micro-rss-parser/versions

## README

<h1 style="text-align: center;">micro-rss-parser</h1>

<div style="text-align: center;">
  <a href="https://circleci.com/gh/relekang/micro-rss-parser/tree/master"><img src="https://circleci.com/gh/relekang/micro-rss-parser/tree/master.svg?style=svg" alt="CircleCI"></a>
  <a href="https://codecov.io/gh/relekang/micro-rss-parser"><img src="https://codecov.io/gh/relekang/micro-rss-parser/branch/master/graph/badge.svg" alt="codecov"></a>
  <a href="https://www.npmjs.com/package/micro-rss-parser"><img src="https://img.shields.io/npm/v/micro-rss-parser.svg" alt="npm version"></a>
</div>

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][]. To specify a specific parser see example queries below.



## Installation

```shell
npm i -g micro-rss-parser
```

## Usage

### CLI for starting the server

```shell
$ micro-rss-parser --help

  Usage: micro-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)
    -R, --raven-dsn     Raven DSN. This is used to configure logging with sentry.io
    -v, --version       Output the version number
```

### Example queries

#### feed(url: String, [parser: Parser])
```graphql
{
  feed(url: "https://rolflekang.com/feed.xml") {
    title
    entries {
      title
      pubDate
      link
    }
  }
}
```

##### Specifying the parser.
micro-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][]

```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

---
_Source: https://npm.io/package/micro-rss-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
