Trevor PaughSystems engineer
Trevor PaughProject Chronicles

Chronicles / Cookbook

Paste the page

Milestone

The import path for sites that refuse every app is in. View the recipe page's source in your browser, copy it, paste it into the Add form, and the page picks out the recipe data and sends only that to the importer, which parses it without fetching anything. A one-click bookmarklet does the copying. Review caught a stripper that could be made very slow by a hostile paste; it was fixed before merge. It goes to the dev site first, and live only when the owner says so.

Some of the most-used recipe sites, Allrecipes, Serious Eats, and the rest of their group, answer anything that is not a browser with a refusal. The importer’s honest user agent cannot read them, and the no-AI-API rule closes every other door. The one reader left is the owner’s own browser. That was the reasoning behind the paste import, approved on 6 October with the pull quote. Today it merged.

How it works

Open the recipe page, view its source, copy it, and paste it into the Add form. The page does the sorting in the browser: it finds the structured recipe blocks that nearly every recipe site embeds for search engines, and sends only those to the same import route the URL path uses. The importer parses each block as it would a fetched page, except that it fetches nothing. For the one-click version there is a draggable bookmarklet, “Copy recipe data,” that does the view-and-copy on the recipe page itself.

Review

The reviewer found one thing that had to change before merge. The importer’s HTML tag stripper used a pattern whose cost grew with the square of the input, so a large, hostile paste could tie up an import for the whole of its time limit. It was rewritten in a linear form, measured at a few milliseconds on the same input, with tests that pin the behaviour. Two small nits went into the same commit. Thirty-nine suites and over four thousand assertions pass.

Where it lands

Per the owner’s condition, the pipeline takes it to the dev site first; it reaches live only when the owner promotes it. The dev stack itself still waits on the owner’s setup steps from the dev-site entry.