Repository navigation
Feat: Read the Instagram caption from the post URL - #23
Conversation
|
The live run failed before it could test anything: Write the recipe and open a pull request on
Session: https://claude.ai/code/session_01PqRBbb6QeVTurq7z7t8zkw Generated by Claude Code |
|
The second run answered the open question: Gemini's URL context cannot read Instagram. Run log.
Decision needed: have the runner fetch the post's public page (or its Session: https://claude.ai/code/session_01PqRBbb6QeVTurq7z7t8zkw Generated by Claude Code |
Eschults
left a comment
There was a problem hiding this comment.
This is a self-review: Claude reviewed a PR it opened, and Edward wrote most of the current code. It is not an approval.
Found
- Medium: the README said
npm installdownloads the browser Playwright drives.playwrighthas no install script, so a local fetch fails atchromium.launch(). - Low:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOADon thenpm cistep does nothing, for the same reason, and its comment says otherwise.
Fixed
- 884a8d5: the README now says to run
npx playwright install chromiumonce, and the local-run commands include it. - Earlier, 319c738:
extract.jsno longer exports the Gemini helpers that only the old caption fetch used. npm test: 18/19 pass.test/render.test.jsneeds anEschults/cookbookcheckout this session cannot reach, and it fails onmaintoo. The live hand-run on93923d7passed.
Left for you
- The unused env var and its comment in
.github/workflows/add-recipe.yml(inline). Harmless, but repo rules mean workflow files need your approval to edit. - Not checked: whether Instagram's
og:descriptionshows the full caption on very long posts. The live run used one reel.
Session: https://claude.ai/code/session_01PqRBbb6QeVTurq7z7t8zkw
claude --teleport session_01PqRBbb6QeVTurq7z7t8zkw
Generated by Claude Code
| env: | ||
| # Only Chromium is used; the next step fetches just that one, with | ||
| # the system libraries it needs to actually launch headless. | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" |
There was a problem hiding this comment.
This does nothing, and it's left for you. playwright 1.63.0 has no install script (its package.json has no scripts, and the lockfile doesn't flag one), so npm ci never downloads a browser to skip. The next step's npx playwright install --with-deps chromium does all the work. The comment above says otherwise, so removing both would be clearer. It's harmless as it stands, and repo rules mean I don't edit workflow files without your approval.
Generated by Claude Code
|
|
||
| ```bash | ||
| npm install | ||
| npx playwright install chromium |
There was a problem hiding this comment.
Fixed in 884a8d5. The README said npm install downloads the browser, but playwright has no install script, so a local run with only a URL would fail at chromium.launch() with "Executable doesn't exist".
Generated by Claude Code
Context
Changes
scripts/add-recipe/instagram.js: when the request has no caption, headless Chromium (Playwright) opens the post and reads the caption and the author's handle from itsog:descriptiontag. No login needed.workflow_dispatch) still skips the fetch, as a fallback. That input is now optional.playwrightis a new dependency.URL_RETRIEVAL_STATUS_ERROR, run).Tests
test/instagram.test.jsruns against a fake browser: happy path, noog:description, a description with no quoted caption, the browser closing on failure, quotes inside a caption, and a supplied caption or handle winning over the fetched one.test/issue.test.jscovers a URL-only form.workflow_dispatchrun on93923d7with only a URL passed.npm test: 18/19 pass.test/render.test.jsneeds anEschults/cookbookcheckout that the Claude session could not reach. It fails onmaintoo.