A simple web service that extracts readable content from web articles using Mozilla's Readability.js. It cleans up cluttered web pages, removes ads, navigation, and other distractions, making articles easier to read. The service includes custom fixes for specific websites and can handle iframes by converting them to clickable links.
Hosted on Vercel, the app provides a clean interface for users to input a URL and view a readable version of the article. It also exposes an API endpoint for programmatic access.
-
Article Extraction: Uses Readability.js to parse and clean web pages.
-
Custom Site Fixes: Special handling for sites like:
and other
-
Iframe Conversion: Optionally converts embedded iframes (e.g., YouTube, VK, Rutube) to plain links for better readability.
-
API Endpoint:
/api/readability?url=<URL>&format=<html|json>&changeiframe=<true|false> -
Frontend Interface: Built with Svelte, allowing users to submit URLs via a simple form.
-
Formats Supported: HTML (default), JSON (metadata + content).
Try it out at: readability-bot-v2.vercel.app
Example API call:
https://readability-bot-v2.vercel.app/api/readability?url=https://example.com/article
To run locally:
-
Clone the repository:
git clone https://github.com/McFev/readability-bot-v2.git cd readability-bot-v2 -
Install dependencies:
npm install -
Run in development mode:
npm run devThis starts a local server with live reloading. Open
http://localhost:5000in your browser. -
Build for production:
npm run build -
Start the production server:
npm start
- Visit the homepage.
- Enter a URL in the input field.
- Click "Read" to view the cleaned article.
- Endpoint:
/api/readability - Query Parameters:
url(required): The URL of the article to process.format(optional, default: html): Output format (html,json).changeiframe(optional, default: false): Set totrueto convert iframes to links.
- Example Response (JSON):
{ "title": "Article Title", "byline": "Author Name", "content": "<div>Readable content...</div>", "textContent": "Plain text version...", "length": 1234, "excerpt": "Short summary...", "siteName": "Site Name", "lang": "en", "publishedTime": "2023-01-01T00:00:00.000Z" }
- Fork this repository.
- Go to Vercel and create a new project.
- Import your forked repo.
- Deploy! Vercel will handle the build and hosting automatically.
Environment Variables (optional):
APP_URL: Custom app URL (defaults to Vercel URL).READABILITY_API_URL: Custom API base URL.
The app is a standard Node.js/Svelte project bundled with Rollup, so it can be deployed to any Node.js-compatible host like Heroku, AWS, or DigitalOcean.
- Core: @mozilla/readability, jsdom, node-fetch
- Build: Svelte, Rollup
- Others: dompurify, html-entities, normalize-url
See package.json for the full list.
Powered by Mozilla Readability. If you find this useful, star the repo! ⭐