Skip to main content

Local Content Extractor Plugin

The Local Content Extractor is the default content extraction plugin for Ever Works. It extracts web page content locally using Mozilla Readability and Turndown, requiring no external API keys.

Source: packages/plugins/local-content-extractor/src/local-content-extractor.plugin.ts

Overview

PropertyValue
Plugin IDlocal-content-extractor
Categorycontent-extractor
Capabilitiescontent-extractor
Version1.0.0
Configuration Mode(default)
Auto-enableYes
System pluginYes
Default forcontent-extractor capability
Dependenciesaxios, @mozilla/readability, linkedom, turndown

The plugin implements IPlugin and IContentExtractorPlugin. It is auto-enabled and serves as the default content extractor, providing a zero-configuration fallback that works without any external API keys.

Architecture

Three-Tier Extraction Strategy

The plugin uses a cascading approach to maximize extraction success:

  1. Readability -- Mozilla's Readability algorithm extracts the main article content, stripping navigation, ads, and boilerplate. This produces the highest-quality output.
  2. Meta description fallback -- If Readability finds insufficient content (below minContentLength), the plugin falls back to the page's <meta name="description"> or <meta property="og:description"> tags.
  3. Body text fallback -- As a last resort, the plugin strips unwanted elements (scripts, styles, nav, sidebar, ads) and returns the cleaned body text.

Configuration

Settings Schema

SettingTypeRequiredDefaultDescription
timeoutnumberNo15000HTTP request timeout in ms (1000--60000, hidden)
minContentLengthnumberNo200Min chars for valid content (0--10000, hidden)
userAgentstringNoChrome UACustom user agent string (hidden)

All settings are hidden from the standard UI because the defaults work well for most use cases.

Content Extraction

Single URL Extraction

async extract(options: ContentExtractionOptions): Promise<ContentExtractionResult>

The extract() method performs a full content extraction pipeline:

  1. Fetches the URL with configurable timeout and user agent.
  2. Validates the content type (only text/html, text/plain, application/xhtml).
  3. Parses the HTML using linkedom.
  4. Extracts metadata (title, description, author, dates, OG tags, Twitter cards).
  5. Attempts Readability extraction.
  6. Falls back through the three-tier strategy if needed.
  7. Converts HTML to markdown using Turndown.
  8. Extracts images and links if requested.

Result Fields

FieldDescription
successWhether extraction succeeded
urlThe requested URL
finalUrlThe resolved URL after redirects
titlePage title (from article or metadata)
contentExtracted text content
htmlExtracted HTML content
markdownContent converted to markdown
imagesArray of extracted images with src, alt, dimensions
linksArray of extracted links with href, text, isExternal
metadataFull page metadata (OG, Twitter, canonical, favicon)
wordCountNumber of words extracted
readingTimeEstimated reading time (words / 200)

Batch Extraction

async extractBatch(
urls: readonly string[],
options?: Partial<ContentExtractionOptions>
): Promise<readonly ContentExtractionResult[]>

Processes URLs in batches of 5 with a 100ms delay between batches to avoid overwhelming target servers.

Metadata Extraction

The plugin extracts comprehensive page metadata:

Metadata FieldSources Checked
title<title> tag
descriptionmeta[name="description"], meta[property="og:description"]
authormeta[name="author"], meta[property="article:author"]
publishedDatearticle:published_time, date, pubdate
language<html lang="...">
keywordsmeta[name="keywords"] (comma-separated)
ogTitle / ogImageOpen Graph tags
twitterCard / twitterTitleTwitter Card tags
canonicalUrl<link rel="canonical">
favicon<link rel="icon"> or <link rel="shortcut icon">

Comparison with Other Content Extractors

FeatureLocal ExtractorFirecrawlJinaTavily
API key requiredNoYesYesYes
JavaScript renderingNoYesYesYes
CostFreePaidPaidPaid
Metadata extractionFull (OG, Twitter, etc.)PartialPartialNone
Image extractionYesYesNoNo
Link extractionYesYesNoNo
Batch supportYes (5 at a time)YesYesYes
Anti-bot bypassNoYesYesYes

The Local Content Extractor is the best choice for cost-free extraction of static content. For JavaScript-heavy pages or sites with anti-bot protections, use a cloud-based extractor like Firecrawl or Jina.

Unwanted Element Removal

When falling back to body text extraction, the plugin removes these elements:

script, style, noscript, iframe, header, footer, nav, aside,
.sidebar, .advertisement, .ad, .ads, .comments, .social-share,
[role="navigation"], [role="banner"], [role="complementary"]

Getting Started

The Local Content Extractor is auto-enabled and requires no configuration. It works out of the box as the default content extraction provider.

To customize its behavior, adjust the hidden settings:

  1. Navigate to the plugin settings page.
  2. Modify timeout, minContentLength, or userAgent as needed.
  3. The plugin will use the updated settings for all future extractions.

Troubleshooting

IssueCauseSolution
"Unsupported content type"URL returns non-HTML contentUse a specialized extractor (e.g., PDF Extractor)
"No extractable content found"Page is JS-rendered or has minimal textUse Firecrawl or Jina for JS-heavy pages
Timeout errorsSlow server or low timeout settingIncrease the timeout setting
Missing images/linksincludeImages/includeLinks set to falseEnsure extraction options include these flags
Redirect loopsToo many redirectsThe plugin follows up to 5 redirects by default