Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

linkvite/article-parser

Repository files navigation

Article Parser

This service converts web pages to a simple reader mode article. Built with Bun and Elysia.

Getting Started

You need to have Bun installed to run this service. To install Bun, check out the documentation.

Prerequisites

  • .env file with PORT

Development

To start the development server run:

bun run dev

Open http://localhost:PORT with your browser to see the result.

Test

To run the tests run:

bun test

Usage

To use the service send a POST request to /parse with the following body:

{
  "html": "<html>...</html>"
}

The response will be:

{
  "status": 200,
  "code": "PARSED_HTML",
  "data": {
    "title": "Article Title",
    "byline": "Article Byline",
    "dir": "ltr",
    "lang": "en",
    "content": "<p>Article Content in HTML</p>",
    "textContent": "Article Content in Text",
    "length": 1234,
    "excerpt": "Article Excerpt",
    "siteName": "Article Site Name",
  }
}

The response.data structure is based on Mozilla Readability.

License

Distributed under the MIT License. See LICENSE for more information.

About

Convert websites to reader mode articles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published