Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdehaan/summarizer
Scrapes a remote page and creates a summary with statistics
https://github.com/pdehaan/summarizer
Last synced: 2 months ago
JSON representation
Scrapes a remote page and creates a summary with statistics
- Host: GitHub
- URL: https://github.com/pdehaan/summarizer
- Owner: pdehaan
- License: unlicense
- Created: 2014-08-24T04:10:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-24T05:00:54.000Z (over 10 years ago)
- Last Synced: 2024-10-02T11:37:59.483Z (3 months ago)
- Language: JavaScript
- Homepage: https://github.com/pdehaan/summarizer
- Size: 152 KB
- Stars: 38
- Watchers: 8
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# summarizer
[![Build Status: Travis](https://travis-ci.org/pdehaan/summarizer.svg?branch=master)](https://travis-ci.org/pdehaan/summarizer)
Scrapes a remote page and creates a summary with statistics.
This package uses a combination of the following modules:
- [summarize](https://www.npmjs.org/package/summarize) — Summarize html content.
- [node-summary](https://www.npmjs.org/package/node-summary) — Summarizes text using a naive summarization algorithm.
- [unfluff](https://www.npmjs.org/package/unfluff) — A web page content extractor.## Installation
```sh
$ npm i summarizer
```### [Example usage](/example.js)
```js
'use strict';var getPage = require('summarizer').getPage;
var uri = 'http://nodejs.org/api/documentation.html';
getPage(uri).then(function (data) {
console.log(JSON.stringify(data, null, 2));
}, console.error);
```#### [Example output](/example.json)
```json
{
"title": "About this Documentation Node.js v0.10.31 Manual & Documentation",
"lang": "en",
"canonicalLink": "http://nodejs.org/api/documentation.html",
"tags": [],
"image": null,
"videos": [],
"text": "The goal of this documentation is to comprehensively explain the Node.js API, both from a reference as well as a conceptual point of view. ...",
"raw": "\n\n...",
"stats": {
"ok": true,
"sentiment": 0.018134715025906734,
"title": "About this Documentation Node.js v0.10.31 Manual & Documentation",
"topics": [
"Stability",
"change",
"..."
],
"words": 414,
"difficulty": 0.6416666666666667,
"minutes": 4,
"image": null
},
"summary": "About this Documentation Node.js v0.10.31 Manual & Documentation..."
}```