{"_id":"@peristyle/emdash-plugin-instagram-to-recipe","_rev":"8-54378f79372b647c4e984c560e57d848","name":"@peristyle/emdash-plugin-instagram-to-recipe","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.0","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"d40f6ac4938ad329c11a7b443adebef8353a98e3","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.0.tgz","fileCount":17,"integrity":"sha512-O9Fj8zODGuP4oKrQ70UdNgD0YhacWkAKpAu21MYg/mjONRWuOyWswKOoHSmw+xKzPHsOTZ7qYBVxrtaw8JJFLg==","signatures":[{"sig":"MEUCIQD51SNkoeBlpHRqRlxUjqgZiFS1Mj/LsDG/GEQsFfqncAIgXK1BKXic5kVbeDjK8NYV/Srf0L6cVWVYi51OZDxcGJc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89193},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"0ab6831365c0526b856ccce7595a787e012a524b","scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.0_1781126219926_0.6863080905879568","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.2","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.2","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"5bf07b75d28de39f43e7bf11e32f7cc7c580421a","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.2.tgz","fileCount":17,"integrity":"sha512-RAXwV0jK9dBr6cQgnHP4q6lWgnKxBykIBsqXJlg3LzDbGanuUk2lyl14UURg+NqiwSMcktsh9WjtCkjyHPgylA==","signatures":[{"sig":"MEUCIQC18oy4Z7qwkPnfohUJmDrNYsRHty7yIuVRysqum+veawIgNwb/t2ff5bZPqBi4jy4+GqWSZovK9Cscv8+RqrSxCXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":129339},"type":"module","_from":"file:peristyle-emdash-plugin-instagram-to-recipe-0.1.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_resolved":"/tmp/4a2d14eedcd2d3bd5e19ff0b7c2c0f00/peristyle-emdash-plugin-instagram-to-recipe-0.1.2.tgz","_integrity":"sha512-RAXwV0jK9dBr6cQgnHP4q6lWgnKxBykIBsqXJlg3LzDbGanuUk2lyl14UURg+NqiwSMcktsh9WjtCkjyHPgylA==","_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.2_1782501931604_0.9570094302695624","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.3","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.3","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"911db8e19ab560de895535aee1232fb57c82fc91","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.3.tgz","fileCount":18,"integrity":"sha512-FbgFd1c+G8d/2gZLC9vn35wgL4bGt5UDc7oIcmIlqfEOwydZKP8TX3RN5xBVkhBpFvS/IfoddzvBSY9n6cy3yw==","signatures":[{"sig":"MEQCICQ0yQEPSyEwNhtearoM98/bT1H8TPPbceP7xe4qqrrqAiB1LayB4tazR9Fgxb8y+0vIeoOW/LuZFFJ4wWtUEbfVVw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135400},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"09e31fefcd6439945a2712a1d8a7e0b69b51cdd8","scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.3_1783040183542_0.6771423604699796","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.4","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.4","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"b11b6541b432ccc67b3d44291ebcce96d1ee9f37","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.4.tgz","fileCount":18,"integrity":"sha512-790WVAETDgEdfNhYOUxDazx8lbzYqDlcOE0NuSPd5SFHp4nbHByWPbmpKKsWc7L0YmNGaKopFUzxhb896AsDeg==","signatures":[{"sig":"MEUCIHfQYxSZKVFgJXudG2kD4RrRxuIRzLGW2hL0+wyxlcePAiEA5n+98QUDBTGT8EbfAP5CQOm5d/OLQtmbBtPTd4ckjCw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":139362},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"59accdc41f93643cf9dba9a8e0d59da116f8d525","scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.4_1783082964335_0.7346218679843559","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.5","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.5","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"0302a3a2993e68bd4bf82b5d8d4a0a503d5ca154","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.5.tgz","fileCount":18,"integrity":"sha512-AAUWCIFCrUthEsw4huyhB6PYFKjP/SDAra6FzA3sW3oOokrklWuc4KoZmjjKmZW6rdhO+8ifew4qgnFqShJU4g==","signatures":[{"sig":"MEUCIQCUeYKe62a82SzfMYg1lwRt5Wjxjiwxv77nAc8iUBcxRAIgfuivwi5EpiB3nk6i7dXKMWqpPofftr0jjvS/JXTNcSI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":141272},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"5cd43f0c21bc6553941f7b20aca33228de739fe0","scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.5_1783088884342_0.34148858435460894","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.1.6","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.1.6","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"8f4b5b9f43d2a97df63f6aa0497557daad8c196a","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.1.6.tgz","fileCount":18,"integrity":"sha512-DgaOaPqKZKCu0OBw1sG4kc+2nThXDvhS+dcqwD8q2AbcboiSPi16HkzGZ8/5JrATb2YuWnbhGtkJIxmOlZhj8g==","signatures":[{"sig":"MEYCIQC9d9VSFb2J8JCX2i3GP/iIZG+15W0Sbzrk7Tyn+G65uQIhAPi5HAjo+TwhEHdIt/MRPIpTAt6OZ/htVfoLR6KwzWWb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147367},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"0cfb344372eb75d3a9c50efaa915f7b4bce1980c","scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.1.6_1783386761016_0.71337579828085","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.2.0","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.2.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"dist":{"shasum":"ee3917930388b7d27d50f29415a37849898d5cf7","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.2.0.tgz","fileCount":18,"integrity":"sha512-SkDmsQmPDdlEwZLvkyIfNoy/DsRe/yVLgiGbbrpkKCEY20Gm6BsOCyFfLhAXG/QCzPoQGg/3vIC1Vcx5N2LSIQ==","signatures":[{"sig":"MEQCH2Jp5iPNpSc2yZ2j0c0KFs/rMAVeesuodOyvAVs2eQgCIQCYW1YlwKwDfn0gVZDnTMA3ZUBA+E6zHxGXXdf8EU6+7g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":184848},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"e49a6564ed77720bdd35c8c513d20da28195c1e2","scripts":{"dev":"tsup --watch","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_npmVersion":"11.6.2","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-instagram-to-recipe_0.2.0_1787158276229_0.03331555992058366","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@peristyle/emdash-plugin-instagram-to-recipe","version":"0.4.0","type":"module","description":"Import Instagram post URLs as recipe drafts in the EmDash admin","publishConfig":{"access":"public"},"types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","preversion":"pnpm typecheck","version":"pnpm build","postversion":"git push --follow-tags","prepublishOnly":"pnpm build"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"devDependencies":{"emdash":"^0.14.0","tsup":"^8.0.0","typescript":"^5.0.0"},"gitHead":"90e7f3546409c3492333401e30206c201086cd41","_id":"@peristyle/emdash-plugin-instagram-to-recipe@0.4.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-vu7t9El6gMDR5veDvE8j2FVRfPccdOBxPo38cmQKqgwz6/TcB/gcIWB4slfjL8lA7QfKbQpXQ42t7wu529AfAA==","shasum":"b4f4107b6ad5c3dded938d95abaa8e94b0de7a66","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-instagram-to-recipe/-/emdash-plugin-instagram-to-recipe-0.4.0.tgz","fileCount":20,"unpackedSize":219853,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDIGNyRC7zEJRAYLoefRKJ6brlALlFVnDZtRpn8LqAU5wIhAI4wGwxvfh1UppCaTgoQb4nJviq/9CHWynGfWuWVXbpI"}]},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"directories":{},"maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-plugin-instagram-to-recipe_0.4.0_1787764266771_0.10659661551827027"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T21:16:59.764Z","modified":"2026-08-26T17:11:07.150Z","0.1.0":"2026-06-10T21:17:00.098Z","0.1.2":"2026-06-26T19:25:31.794Z","0.1.3":"2026-07-03T00:56:23.702Z","0.1.4":"2026-07-03T12:49:24.476Z","0.1.5":"2026-07-03T14:28:04.504Z","0.1.6":"2026-07-07T01:12:41.180Z","0.2.0":"2026-08-19T16:51:16.365Z","0.4.0":"2026-08-26T17:11:06.983Z"},"description":"Import Instagram post URLs as recipe drafts in the EmDash admin","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"readme":"# @peristyle/emdash-plugin-instagram-to-recipe\n\nImport public Instagram posts into your [EmDash](https://www.npmjs.com/package/emdash) site as draft recipe posts — one at a time by URL, or in bulk by scanning a profile.\n\nFor a post URL such as [instagram.com/p/DcekoblRCc5](https://www.instagram.com/p/DcekoblRCc5/) — a recipe from [@toscanos_table](https://www.instagram.com/toscanos_table/) — the plugin will:\n\n1. Fetch the post and read the caption (profile API first, HTML Open Graph metadata as fallback)\n2. Parse ingredients (`What you'll need` / `Ingredients:`) and numbered steps — including captions Instagram has collapsed onto one line\n3. Download the post **feed image** (the embedded `display_url`, not the OG share-card with a play button) and store its dimensions for responsive images\n4. Create a **draft** post in your configured collection\n\n## Install\n\n```bash\npnpm add @peristyle/emdash-plugin-instagram-to-recipe\n# or: npm install / yarn add\n```\n\nRegister in `astro.config.mjs`:\n\n```javascript\nimport { instagramToRecipePlugin } from \"@peristyle/emdash-plugin-instagram-to-recipe\";\n\nexport default defineConfig({\n  integrations: [\n    emdash({\n      plugins: [instagramToRecipePlugin()],\n    }),\n  ],\n});\n```\n\nRebuild or restart the dev server after adding the plugin.\n\n### Prepare the target collection\n\nEmDash stores each collection field as a real database column, so **the\ncollection you import into must declare every field the plugin writes** — an\nundeclared field fails the whole import with `no column named ...`.\n\nIn the admin, open **Content Types → <your recipe collection>** and make sure\nthese fields exist (slugs must match exactly):\n\n| slug                  | type           | notes                              |\n| --------------------- | -------------- | ---------------------------------- |\n| `title`               | string         | usually already present            |\n| `excerpt`             | text           |                                    |\n| `ingredients`         | portableText   |                                    |\n| `recipe_instructions` | portableText   |                                    |\n| `difficulty`          | string         |                                    |\n| `featured_image`      | image          |                                    |\n| `instagram_url`       | url            | provenance                         |\n| `instagram_caption`   | text           | provenance — raw caption           |\n| `import_notes`        | text           | provenance — parse gaps            |\n| `instagram_video`     | file           | source video for video posts       |\n\nThen set **Content collection** in the plugin's settings to that collection's\nslug. The default is `posts`; if your site's recipe collection is called\nsomething else, imports will fail until you change it.\n\n## Admin usage\n\nOpen **Plugins → Import from Instagram** in the EmDash admin. The page has three sections:\n\n### Single post\n\n1. Paste an Instagram post URL and click **Convert to recipe**\n2. Review the parsed preview (title, ingredients, steps, featured image)\n3. Click **Create draft post**\n4. Edit the draft under **Posts** (slug, categories, times, publish)\n\n### Bulk import from a profile\n\n1. Enter a public Instagram handle, optionally set **Posted on or after** / **Posted on or before**, and click **Scan profile**\n2. The profile grid is fetched in a single request and every caption that parses as a recipe is listed with its post date, sorted by likes\n3. Check the recipes you want (already-imported posts are unchecked and labeled) and click **Create selected drafts**\n4. Posts that **didn't** parse as recipes are listed under **Other posts** — check any of them and click **Create stub drafts** to import the image and raw caption with empty recipe fields, flagged in `import_notes` for manual or AI completion\n\nBulk import is idempotent — posts already imported are skipped. Deleting an imported draft clears the bookkeeping, so the post can be imported again later.\n\n#### Date range\n\nThe date fields are **inclusive** and filter the posts the scan already\nfetched. They cannot make the scan reach further back: one profile request\nreturns roughly the 12 most recent posts, so a range starting before that\nwindow would otherwise silently miss older posts. The UI is built so that\nnever goes unsaid:\n\n- After a scan, the form itself names the window it reached (“This scan reaches\n  back to 2026-01-15; a range starting earlier will miss posts”)\n- Every result reports posts scanned, posts matched, and the oldest date reached\n- A range starting before the oldest scanned post raises a warning naming the\n  cut-off, so “0 results” is never mistaken for “nothing exists”\n- A range that matches nothing gets its own banner plus a **Clear dates** button\n  that restores the full scan — served from the 24-hour cache, so it costs no\n  extra Instagram request\n- Posts Instagram returned without a date are kept rather than dropped, and\n  their count is reported\n\nResults are ordered by likes; when a date range is active they switch to newest\nfirst, matching how the list is being read.\n\nThe admin shows a spinner and blocks input for the duration of any interaction,\nso the copy sets expectations instead: a scan takes seconds (longer while\nInstagram throttles), and creating drafts downloads each post's image and video\nbefore saving — roughly a second or more per post.\n\n### Settings\n\n- **Content collection** — where drafts are created (default: `posts`)\n- **Instagram handle** (optional) — pre-fills the bulk scan and lets single-post imports go straight to the profile API; when empty, the post owner's handle is detected automatically\n\n> Standard-format EmDash plugins are configured here (settings are stored in the plugin's KV store), not via constructor options.\n\n## Capabilities\n\n| Capability        | Purpose                             |\n| ----------------- | ----------------------------------- |\n| `network:request` | Fetch Instagram HTML and CDN images |\n| `content:read`    | Check for prior imports             |\n| `content:write`   | Create draft posts                  |\n| `media:write`     | Upload featured images and source videos |\n\nAllowed hosts: `www.instagram.com`, `*.cdninstagram.com`, `*.fbcdn.net`.\n\n## API routes\n\nFor scripting or a custom admin UI:\n\n| Route          | Method | Body                                  |\n| -------------- | ------ | ------------------------------------- |\n| `parse`        | POST   | `{ \"url\": \"https://www.instagram.com/p/DcekoblRCc5/\" }` |\n| `create-draft` | POST   | `{ \"shortcode\": \"DcekoblRCc5\" }`      |\n| `bulk-scan`    | POST   | `{ \"handle\": \"toscanos_table\", \"from\": \"2026-01-01\", \"to\": \"2026-06-30\" }` (`from`/`to` optional) |\n| `bulk-create`  | POST   | `{ \"shortcodes\": [\"DcekoblRCc5\"] }`   |\n| `create-stub`  | POST   | `{ \"shortcode\": \"DcekoblRCc5\" }` or `{ \"url\": \"https://www.instagram.com/p/DcekoblRCc5/\" }` |\n\n`bulk-scan` returns both `candidates` (parsed recipes) and `unparsed` (posts\nthe recipe parser rejected, with their full captions), plus the coverage the\ncaller needs to judge completeness: `scanned` (posts fetched), `matched` (posts\nleft after the date range), `window` (`oldest`/`newest` dates reached),\n`rangeBeyondScan` (the range asks for posts older than the scan reached), and\n`undated`. `create-stub` imports a\npost **without** parsing: the draft gets the image, raw caption, and a title\nguess, with empty recipe fields and an `import_notes` marker — intended for\nprose \"inspo\" captions that a human or AI agent will structure after import.\nIt is idempotent: an already-imported shortcode returns the existing draft.\n\nBase path: `/_emdash/api/plugins/peristyle-instagram-to-recipe/<route>`\n\n## Provenance fields & AI refinement\n\nEvery draft the plugin creates carries the original post alongside the parsed\nrecipe:\n\n| Field               | Contents                                                            |\n| ------------------- | ------------------------------------------------------------------- |\n| `instagram_url`     | Permalink of the source post                                        |\n| `instagram_caption` | The full raw caption, untouched                                     |\n| `import_notes`      | Parse gaps, when any: lenient parse, missing ingredients/steps, video source, stub import |\n| `instagram_video`   | For video posts: the source video, saved to the media library at import   |\n\nThese fields must exist on the target collection (see\n[Prepare the target collection](#prepare-the-target-collection)) — they are not\noptional; the import fails without them. They are not part of the default\ntheme, so nothing renders publicly.\n\nThey exist mainly so an AI agent connected to your site's MCP server\n(`/_emdash/api/mcp`) can refine imports without re-fetching Instagram: the raw\ncaption is the ground truth, and `import_notes` says exactly what the parser\ncould not recover. A refinement pass — run by hand or on a schedule — looks\nlike:\n\n1. Optionally `bulk-scan` first and triage the `unparsed` list: real recipes in\n   prose captions get `create-stub`, everything else is ignored\n2. `content_list` drafts in the recipe collection; triage by `import_notes`\n3. For each draft, `content_get` and rebuild missing ingredients/steps from\n   `instagram_caption`; write a real excerpt; fill times/servings when the\n   caption states them\n4. `content_update` the draft (revisions provide the undo path); leave it in\n   draft for approval, or `content_publish` if you trust the loop\n\nFor video posts, the source video is downloaded at import time (CDN URLs\nexpire quickly) and stored in the media library, referenced from\n`instagram_video` — so a transcription step (e.g. the agent fetching the file\nand running speech-to-text) can recover spoken instructions that never made it\ninto the caption. Videos over 60MB are skipped; when no video could be saved,\n`import_notes` says the recipe may be spoken and unrecoverable from text.\n\n## Limitations\n\n- **Public posts only** — private or login-walled posts cannot be read\n- **Caption format** — works best with a “What you'll need” / “Ingredients:” section plus numbered steps\n- **Bulk scan depth** — one profile request returns roughly the 12 most recent posts; the date range narrows that window but cannot extend it, and older posts can still be imported individually by URL\n- **Instagram rate limits** — repeated fetches may hit HTTP 429; responses are cached for 24 hours and stale cache is used as a fallback, but you may need to wait and retry\n- **No transcription** — video posts save the source video (≤60MB) to the media library for later transcription, but spoken/on-screen recipe text is not extracted automatically; the featured image is still the feed thumbnail\n\n## Building from source\n\nThe TypeScript source ships in the package under `src/`. From an unpacked copy:\n\n```bash\npnpm install\npnpm build\npnpm typecheck\n```\n\nThe development repository is not currently public.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}