SKILL.md
Advertorial Swiper
Swipe an advertorial end-to-end into durable artifacts.
What it does:
- Loads the advertorial URL.
- Scrolls to the end of the page.
- Clicks the primary CTA (e.g. “Check availability now”, “Special offer”, etc.).
- Continues through sales/checkout steps until it detects a billing/payment form.
- For each page/step, captures:
- Step 1 (advertorial): step-01.jpg above-the-fold screenshot (no scrolling) - Steps 2+ (offer/checkout): step-02.jpg, step-03.jpg, ... as full-page screenshots - waits a couple seconds before screenshotting (configurable) - step-XX.html (best-effort) - step-XX.json metadata (incl. billing-form detection) - step-XX.md markdown via https://r.jina.ai/<URL> (default on)
Then sync artifacts to R2 (public URLs) and append the results to a Notion page.
Setup (first time only)
From the skill folder:
npm install
npx playwright install chromium
Workflow
1) Swipe the advertorial (multi-page)
Run:
node scripts/swipe.js "<advertorial_url>"
Optional env:
OUT_DIR=/path/to/outputs (default ./outputs)
RUN_ID=... (otherwise uses timestamp)
SWIPE_KEY=... (stable key; otherwise derived from URL)
MAX_PAGES=8
STOPATBILLING=true|false (default true)
VIEWPORTW=1280 / VIEWPORTH=720
JPG_QUALITY=82
SCROLL_SCREENSHOTS=true|false (default true)
WAITBEFORESCREENSHOT_MS=2000
MAXSCREENSHOTSPER_PAGE=30
CAPTURE_MARKDOWN=true|false (default false)
Output directory:
outputs/run-<swipeKey>-<runId>/...
2) Upload artifacts to R2 (deterministic)
Run:
SRCDIR=<outDir> node scripts/r2sync.js
Required env (recommend skill-local ./.env):
R2_ENDPOINT
R2_BUCKET
R2PUBLICBASE (e.g. https://pub-....r2.dev)
R2ACCESSKEY_ID
R2SECRETACCESS_KEY
Optional env:
Notes:
r2_sync.js uploads only images (JPG) to R2 to save costs.
Writes:
r2-manifest.json into SRC_DIR
3) Append to Notion page
Run:
SRCDIR=<outDir> node scripts/publishnotion.js
Required env (in ./.env):
NOTIONAPIKEY
NOTIONPARENTPAGE_ID (preferred)
Optional env:
NOTIONPAGEID (fallback: append to an existing page)
Notes:
- The markdown is appended as one or more Notion
code blocks (language=markdown) to avoid “markdown→Notion” conversion complexity.
- The screenshot is added as an external image (best when
r2-manifest.json is present).