Skip to main content

Module url_preview

Module url_preview 

Source
Expand description

Parses the <head> of an HTML page and extracts the fields needed to render a link preview card in a post: title, description, image, and canonical URL.

Open Graph (og:title, og:description, og:image, og:url) is preferred; the extractor falls back to the page’s <title> element and <meta name="description"> when OG isn’t present. The UrlPreviewData struct is what callers hand up to the protocol layer — servers fetch the target URL under an RPC budget gated by POW_MINIMUM_PER_URL_FETCH and return this struct back to the client so the preview card can render without every client individually fetching (and thus leaking its IP to) the target site.

Structs§

UrlPreviewData

Functions§

extract_url_preview