# yan-crawler

> Yet another Node crawler.

Latest version **0.2.1** (published 2016-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install yan-crawler
pnpm add yan-crawler
yarn add yan-crawler
bun add yan-crawler
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-10-11 |
| First published | 2015-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Florin-Cristian Gavrila |
| Maintainers | cgavrila |
| Keywords | crawler |

## Links

- npm: https://www.npmjs.com/package/yan-crawler
- Repository: https://github.com/CGavrila/yan-crawler
- Homepage: https://github.com/CGavrila/yan-crawler#readme
- Issues: https://github.com/CGavrila/yan-crawler/issues
- npm.io page: https://npm.io/package/yan-crawler

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [cheerio](https://npm.io/package/cheerio.md) ^0.19.0
- [request](https://npm.io/package/request.md) ^2.61.0

## Recent versions

- 0.2.1 (latest) — 2016-10-11
- 0.2.0 — 2016-10-10
- 0.1.0 — 2016-10-09
- 0.0.1 — 2015-08-24

## README

Overview
---
Simple module which allows you to poll websites at regular intervals and extract whatever information you want from the response. Strictly speaking, it's not a crawler. If you are looking for one, there are some quite popular alternatives out there like [node-crawler](https://github.com/sylvinus/node-crawler).

Installation
---
```
npm install yan-crawler
```

Usage
---
```javascript
var Crawler = require('yan-crawler').Crawler;
var crawler = Crawler.getInstance();

var amazonTemplate = {
    name: 'Amazon',
    url: 'https://www.amazon.com/',
    interval: 3000,
    callback: function(body, $) {
        // $ is cheerio - https://github.com/cheeriojs/cheerio
        console.log("Grabbed Amazon.");
    }
};

var IMDBTemplate = {
    name: 'IMDB',
    interval: 2000,
    url: 'http://www.imdb.com',
    callback: function(body, $) {
        console.log('Grabbed IMDB.');
    }
};

crawler.addEntry(amazonTemplate);
crawler.addEntry(IMDBTemplate);
crawler.start();
```

The code above will make requests to `www.amazon.com` every 3000ms and to `www.imdb.com` every 2000ms, calling their respective callbacks when it gets the results.

License
---
MIT

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