06 Variables and Filters
Web Clipper: Variables and Filters
Variables pull data out of a page. Filters reshape it. Together they are how a template turns a web page into the document you actually want.
Preset variables
Automatically pulled from every page:
| Variable | What it gives you |
|---|---|
| title | The page title |
| author | The author, where the page declares one |
| description | The page description |
| published | The published date |
| domain | The site's domain |
| url | The full URL |
| content | The extracted article content |
| highlights | Your saved highlights |
| selection | The text you had selected |
| image | The social/share image |
| word count | The length of the article |
Meta variables
Read any <meta> tag or Open Graph tag from the page. Anything the page tells crawlers about itself, you can use.
Selector variables
Extract any element's text or HTML using a CSS selector.
This is the escape hatch. When a page holds something no preset covers — a price, a rating, a byline in an unusual place — a selector gets it. It is also the most fragile approach, since it breaks when the site changes its markup. Prefer schema.org or meta variables where they exist.
Schema.org variables
Read the structured data embedded in the page. Many sites publish rich, reliable schema.org data — recipes, products, articles, events — and reading it is far more robust than scraping the rendered HTML.
If a page has schema.org data, use it. It is the most stable source available.
Filters
A large library transforms variable values:
- Date formatting.
- Case conversion.
- Markdown conversion — turn extracted HTML into clean markdown.
- List, table and callout formatting — turn an array into a bulleted list, a table, or a callout block.
- Math.
- Array and object manipulation — map, filter, join, pick.
- HTML cleanup.
Filters chain, so you can take a raw value, clean it, reshape it, and format it in one expression.
Debugging
Inspect the page variables available for templates before clipping. It shows what the page actually exposes on this page.
When a template produces something wrong, this is the first place to look. Usually the variable you assumed exists simply is not there — the page never declared an author, or the published date is in an unexpected format.
A practical approach
- Inspect the variables on a page you clip often.
- Prefer schema.org, then meta, then selectors — in that order of robustness.
- Add filters to tidy the output.
- Reach for a prompt variable (08 AI Interpreter) only when the information genuinely is not in the page's data — a summary, a judgement, a categorization. Do not use a language model to extract something a meta tag already states exactly.