# blog-scraper

> A general blog scraper

Latest version **0.2.2** (published 2014-09-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install blog-scraper
pnpm add blog-scraper
yarn add blog-scraper
bun add blog-scraper
```

## 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.2 |
| Published | 2014-09-15 |
| First published | 2014-09-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | ile |

## Links

- npm: https://www.npmjs.com/package/blog-scraper
- npm.io page: https://npm.io/package/blog-scraper

## Dependencies (7)

- [async](https://npm.io/package/async.md) *
- [jsdom](https://npm.io/package/jsdom.md) *
- [moment](https://npm.io/package/moment.md) *
- [cheerio](https://npm.io/package/cheerio.md) ^0.17.0
- [request](https://npm.io/package/request.md) ^2.39.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^0.2.7
- [mongoskin](https://npm.io/package/mongoskin.md) *

## Recent versions

- 0.2.2 (latest) — 2014-09-15
- 0.2.1 — 2014-09-15
- 0.2.0 — 2014-09-15
- 0.1.0 — 2014-09-15

## README

blog-scraper
================

A general blog scraper.

Saves data to mongodb. 

## install

`npm install blog-scraper`
 
## usage

### from the command line
`./scrape <url> [db-name]`

- `url` should be the url to the first post. On that blog page should be a link to the next post.
- db-name is `blog-scraper` by default.

### as a Nodejs module

```javascript
var scraper = require('blog-scraper');
scraper.init('db-name', options);
```

options has these defaults, any of which can be changed by passing an object to scraper.init():

```javascript
options = {
	title: 'div.contentContainer section.wide-article > article header h1',
	body: 'div.contentContainer section.wide-article > article div.article-body',
	comments: 'section.comment-list > section',
	time: 'div.contentContainer section.wide-article > article time',
	next: '.article-actions .continue-reading .next a'
}
```

Note: the time extraction expects a `datetime` attribute at the selector's target element.

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