https://github.com/smartive/proc-that-rest-extractor
Extractor for proc-that. Loads items from REST APIs
https://github.com/smartive/proc-that-rest-extractor
Last synced: 3 months ago
JSON representation
Extractor for proc-that. Loads items from REST APIs
- Host: GitHub
- URL: https://github.com/smartive/proc-that-rest-extractor
- Owner: smartive
- License: mit
- Created: 2016-03-28T09:04:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T03:43:23.000Z (4 months ago)
- Last Synced: 2025-03-21T19:49:46.896Z (4 months ago)
- Language: TypeScript
- Homepage: http://smartive.github.io/proc-that-rest-extractor
- Size: 308 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RestExtractor
Modular extractor for `proc-that`. Loads items from REST APIs via http requests.
Uses [restler](https://github.com/danwrong/restler) for downloading resources.##### A bunch of badges
[](https://travis-ci.org/smartive/proc-that-rest-extractor)
[](https://ci.appveyor.com/project/buehler/proc-that-rest-extractor)
[](https://www.npmjs.com/package/proc-that-rest-extractor)
[](https://coveralls.io/github/smartive/proc-that-rest-extractor)
[](https://github.com/smartive/proc-that-rest-extractor)
[](https://github.com/semantic-release/semantic-release)
[](https://greenkeeper.io/)## Installation
```bash
npm install --save proc-that-rest-extractor
```## Usage
```typescript
import {Etl} from 'proc-that';
import {RestExtractor} from 'proc-that-rest-extractor';let extractor = new RestExtractor('http://my-rest-url.com/posts');
new Etl().addExtractor(extractor).start().subscribe(/*...*/);
```### Custom result set
If the called API delivers a masked result (i.e. a JSON object with a `data` property)
you can pass a function into the constructor that is called on the result.```typescript
import {Etl} from 'proc-that';
import {RestExtractor, RestExtractorMethod} from 'proc-that-rest-extractor';let extractor = new RestExtractor('http://my-rest-url.com/posts', RestExtractorMethod.Get, result => result.data);
new Etl().addExtractor(extractor).start().subscribe(/*...*/);
```