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 to 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 | ```bash
|
12 | $ npm install --save aimer
|
13 | ```
|
14 |
|
15 | For Single Page Apps please head to [aimer-nightmare](https://github.com/egoist/aimer-nightmare)
|
16 |
|
17 | ## Usage
|
18 |
|
19 | ```js
|
20 | const aimer = require('aimer')
|
21 |
|
22 | aimer('http://some-url.com/a/b/c')
|
23 | .then($ => {
|
24 | $('img.nice-images').each(function () {
|
25 | const url = $(this).attr('src')
|
26 | console.log(url)
|
27 | })
|
28 | })
|
29 | ```
|
30 |
|
31 | ## API
|
32 |
|
33 | ### aimer(url, opts)
|
34 |
|
35 | #### opts
|
36 |
|
37 | ##### cheerio
|
38 |
|
39 | [cheerio](https://github.com/cheeriojs/cheerio) options. Except `decodeEntities` is `false` by default here.
|
40 |
|
41 | ## License
|
42 |
|
43 | MIT © [EGOIST](https://github.com/egoist)
|