Skip to content

Commit

Permalink
✌️
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Feb 12, 2023
1 parent c957237 commit 120a446
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
summaly
================================================================

[![Greenkeeper badge](https://badges.greenkeeper.io/syuilo/summaly.svg)](https://greenkeeper.io/)

[![][npm-badge]][npm-link]
[![][mit-badge]][mit]
[![][travis-badge]][travis-link]
[![][himawari-badge]][himasaku]
[![][sakurako-badge]][himasaku]

[![NPM](https://nodei.co/npm/summaly.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/summaly)

Get any web page's summary. [Try it out](https://runkit.com/npm/summaly)

Installation
----------------------------------------------------------------
`$ npm install summaly`
```
npm install git+https://github.com/misskey-dev/summalygit
```

Usage
----------------------------------------------------------------
``` javascript
As a function:

```javascript
import { summaly } from 'summaly';

summaly(url[, opts])
```

As Fastify plugin:
(will listen `GET` of `/url`)

```javascript
import Summaly from 'summaly';

fastify.register(Summaly[, opts])
```

Run the server:

```
npm run build
npm run serve
```

### Options

| Property | Type | Description | Default |
Expand All @@ -43,6 +57,8 @@ interface IPlugin {

A Promise of an Object that contains properties below:

※ Almost all values are nullable. player shoud not be null.

#### Root

| Property | Type | Description |
Expand All @@ -66,7 +82,7 @@ A Promise of an Object that contains properties below:
### Example

``` javascript
import summaly from 'summaly';
import { summaly } from 'summaly';

const summary = await summaly('https://www.youtube.com/watch?v=NMIEAhH_fTU');

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function (fastify: FastifyInstance, options: Options, done: (err?
url?: string;
lang?: string;
};
}>('/', async (req, reply) => {
}>('/url', async (req, reply) => {
const url = req.query.url as string;
if (url == null) {
return reply.status(400).send({
Expand Down

0 comments on commit 120a446

Please sign in to comment.