This service converts web pages to a simple reader mode article. Built with Bun and Elysia.
You need to have Bun installed to run this service. To install Bun, check out the documentation.
.env
file with PORT
To start the development server run:
bun run dev
Open http://localhost:PORT with your browser to see the result.
To run the tests run:
bun test
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.
Distributed under the MIT License. See LICENSE
for more information.