MCPcopy Index your code
hub / github.com/borderless/unfurl

github.com/borderless/unfurl @v0.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.0 ↗ · + Follow
75 symbols 205 edges 8 files 39 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Scrappy

NPM version NPM downloads Build status Test coverage

Extract rich metadata from URLs.

Try it using Runkit!

Installation

npm install scrappy --save

Usage

Scrappy attempts to parse and extract rich structured metadata from URLs.

import { scraper, urlScraper } from "scrappy";
import * as plugins from "scrappy/dist/plugins";

Scraper

Accepts a request function and a list of plugins to use. The request is expected to return a "page" object, which is the same shape as the input to scrape(page).

const scrape = scraper({
  request,
  plugins: [plugins.htmlmetaparser, plugins.exifdata],
});

const res = await fetch("http://example.com"); // E.g. `popsicle`.

await scrape({
  url: res.url,
  status: res.status,
  headers: res.headers.asObject(),
  body: res.stream(), // Must stream the request instead of buffering to support large responses.
});

URL Scraper

Simpler wrapper around scraper that automatically makes a request(url) for the page.

const scrape = urlScraper({ request });

await scrape("http://example.com");

License

Apache 2.0

Extension points exported contracts — how you extend this code

ExtractOptions (Interface)
* Options used for extracting metadata.
src/plugins/htmlmetaparser.ts
Options (Interface)
(no doc)
src/index.ts
Page (Interface)
(no doc)
src/types.ts
JsonLdValue (Interface)
(no doc)
src/plugins/htmlmetaparser.ts
RequestOptions (Interface)
(no doc)
src/types.ts
JsonLd (Interface)
(no doc)
src/plugins/htmlmetaparser.ts
Input (Interface)
(no doc)
src/types.ts
Snippet (Interface)
(no doc)
src/types.ts

Core symbols most depended-on inside this repo

first
called by 26
src/plugins/htmlmetaparser.ts
toUrl
called by 14
src/plugins/htmlmetaparser.ts
jsonLdArray
called by 14
src/plugins/htmlmetaparser.ts
toNumber
called by 12
src/plugins/htmlmetaparser.ts
toString
called by 11
src/plugins/htmlmetaparser.ts
jsonLdValueToString
called by 11
src/plugins/htmlmetaparser.ts
toArray
called by 10
src/plugins/htmlmetaparser.ts
parseExifDate
called by 6
src/plugins/exifdata.ts

Shape

Function 59
Interface 16

Languages

TypeScript100%

Modules by API surface

src/plugins/htmlmetaparser.ts46 symbols
src/types.ts12 symbols
src/plugins/exifdata.ts6 symbols
src/helpers/index.ts5 symbols
src/index.ts3 symbols
src/index.spec.ts3 symbols

For agents

$ claude mcp add unfurl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact