1 | # aimer [![NPM version](https://img.shields.io/npm/v/aimer.svg)](https://npmjs.com/package/aimer) [![NPM downloads](https://img.shields.io/npm/dm/aimer.svg)](https://npmjs.com/package/aimer) [![Circle CI](https://circleci.com/gh/egoist/aimer/tree/master.svg?style=svg)](https://circleci.com/gh/egoist/aimer/tree/master)
|
2 |
|
3 | > Remote web content crawler done right.
|
4 |
|
5 | ## Motivation
|
6 |
|
7 | Sometimes I want grab some nice images from a url like http://bbs.005.tv/thread-492392-1-1.html, so I made this little program to combine `node-fetch` and `cheerio` to make my attempt fulfilled.
|
8 |
|
9 | ## Install
|
10 |
|
11 | ```
|
12 | $ npm install --save aimer
|
13 | ```
|
14 |
|
15 | ## Usage
|
16 |
|
17 | ```js
|
18 | const aimer = require('aimer')
|
19 |
|
20 | aimer('http://some-url.com/a/b/c')
|
21 | .then($ => {
|
22 | $('img.nice-images').each(function () {
|
23 | const url = $(this).attr('src')
|
24 | console.log(url)
|
25 | })
|
26 | })
|
27 | ```
|
28 |
|
29 | ## API
|
30 |
|
31 | ### aimer(url, opts)
|
32 |
|
33 | **opts**
|
34 |
|
35 | [cheerio](https://github.com/cheeriojs/cheerio) options. Except `decodeEntities` is `false` by default here.
|
36 |
|
37 | ## License
|
38 |
|
39 | MIT © [EGOIST](https://github.com/egoist)
|