2017-02-08 15:45:48 +09:00
2017-02-08 15:45:48 +09:00
2017-01-15 08:11:49 +09:00
2016-12-11 23:13:58 +09:00
2017-01-31 00:25:44 +09:00
2017-01-15 09:03:08 +09:00
2017-01-15 08:12:20 +09:00
2017-02-08 15:17:28 +09:00
2017-02-08 15:17:28 +09:00
2017-01-30 08:43:24 +09:00
2017-01-30 09:06:44 +09:00

summaly

NPM

Get any web page's summary. Try it out

Installation

$ npm install summaly

Usage

summaly(url[, opts])

Options

Property Type Description Default
followRedirects boolean リダイレクトを解決するかどうか true
plugins plugin[] (see below) Custom plugins null

Plugin

interface IPlugin {
	test: (url: URL.Url) => boolean;
	summarize: (url: URL.Url) => Promise<Summary>;
}

Returns

A Promise of an Object that contains properties below:

Property Type Description
description string The description of そのWebページ
icon string The url of the icon of そのWebページ
sitename string The name of そのWebサイト
thumbnail string The url of the thumbnail of そのWebページ
title string The title of そのWebページ
url string The url of そのWebページ

Example

import summaly from 'summaly';

const summary = await summaly('http://elephant.2chblog.jp/archives/52025138.html');

console.log(summary); // will be ... ↓
/*
{
	title: 'モバP「ありすと言えばお漏らし。お漏らしと言えばありす」',
	icon: 'http://livedoor.blogimg.jp/tmg24news/imgs/9/5/favicon.ico',
	description: '1以下、名無しにかわりましてVIPがお送りします2013/03/30(土) 14:57:29.09 ID:An34eOmY0モバ「反論が あるやつもいるかもしれない」    モバP「だが俺の主張も聞いてほしい! お漏らしさせるならありすが一番だ!」    日菜子「むふふ……いきなりそんなことを大声で',
	thumbnail: 'http://livedoor.blogimg.jp/tmg24news/imgs/8/d/8df6e1a0-s.jpg',
	sitename: 'エレファント速報SSまとめブログ',
	url: 'http://elephant.2chblog.jp/archives/52025138.html'
}
*/

Testing

npm run test

License

MIT

Description
? Get a summary of any web page
Readme MIT 1.3 MiB
Languages
TypeScript 76.3%
HTML 11.9%
JavaScript 11.8%