@trawlme/skills 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -61,14 +61,15 @@ trawl scraps data <id> --json # last run output (the scraped data)
|
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
trawl scraps create -t "Daily prices" -u "https://example.com/products" \
|
|
64
|
-
-
|
|
64
|
+
-d "Tracks product prices on Example.com daily" \
|
|
65
|
+
-r '<puppeteer script>'
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
Flags:
|
|
68
69
|
- `-t, --title` (required) — display name
|
|
69
70
|
- `-u, --url` — target URL (also exposed as `TRAWL.url` in the script)
|
|
71
|
+
- `-d, --description` — what the scrap does (used by wizard few-shot examples + future marketplace listing)
|
|
70
72
|
- `-r, --request` — the Puppeteer script body (must call `returnData(arr)`)
|
|
71
|
-
- `-s, --scrapper` — engine, defaults to `puppeteer`
|
|
72
73
|
|
|
73
74
|
For the script body, see the `trawl-scrap-design` skill.
|
|
74
75
|
|
|
@@ -76,6 +77,7 @@ For the script body, see the `trawl-scrap-design` skill.
|
|
|
76
77
|
|
|
77
78
|
```bash
|
|
78
79
|
trawl scraps update <id> -t "New title" --cron "0 9 * * *"
|
|
80
|
+
trawl scraps update <id> -d "Updated description" # update what it does
|
|
79
81
|
trawl scraps update <id> --no-cron # disable schedule
|
|
80
82
|
trawl scraps update <id> --alert ops@example.com # email on failure
|
|
81
83
|
trawl scraps update <id> --no-alert # disable alerts
|
|
@@ -118,7 +120,7 @@ trawl scraps watch <id> # if running, see live errors
|
|
|
118
120
|
|
|
119
121
|
**"Create a job that runs every morning"**
|
|
120
122
|
```bash
|
|
121
|
-
trawl scraps create -t "Morning crawl" -u "https://..." -r '...'
|
|
123
|
+
trawl scraps create -t "Morning crawl" -u "https://..." -d "Daily crawl at 8am" -r '...'
|
|
122
124
|
trawl scraps update <new-id> --cron "0 8 * * *"
|
|
123
125
|
```
|
|
124
126
|
|
|
@@ -136,6 +138,7 @@ Scrap object shape:
|
|
|
136
138
|
{
|
|
137
139
|
"_id": "507f1f77bcf86cd799439011",
|
|
138
140
|
"title": "...",
|
|
141
|
+
"description": "What this scrap does",
|
|
139
142
|
"url": "https://...",
|
|
140
143
|
"request": "var page = ...",
|
|
141
144
|
"scrapper": "puppeteer",
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trawl-scrap-banner
|
|
3
|
+
description: Generate + upload a brand-aware banner (1200x630 PNG) for a Trawl scrap. Fetches the official brand logo from Wikimedia Commons, composes against a gradient or flat brand-color background, renders via Chrome headless, uploads via `trawl scraps banner`. Triggers on "make banner for my scrap", "generate scrap banner", "upload banner for {site}". Does NOT cover scrap script generation (see trawl-scrap-design) or CLI account management (see trawl-cli).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Trawl Scrap Banner
|
|
7
|
+
|
|
8
|
+
Generate + upload a brand-aware 1200x630 banner for a Trawl scrap. Prototype validated 2026-05-10 on eBay.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
After a scrap ships to prod (post-cron-activation, pre-Done). Default step in the seed roadmap workflow — banners are part of "Done" by convention.
|
|
13
|
+
|
|
14
|
+
Skip for internal/non-discoverable scraps (no UI surface).
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
- `scrapId` — Trawl scrap ID (24-hex), required
|
|
19
|
+
- `siteName` — brand name in URL form (`ebay`, `yahoo-finance`, `github`…), required
|
|
20
|
+
- `tagline` — short text under the logo, e.g. `"Comp pricing · Item watchlist"`, optional
|
|
21
|
+
|
|
22
|
+
## Pipeline
|
|
23
|
+
|
|
24
|
+
### 1. Fetch logo
|
|
25
|
+
|
|
26
|
+
Search Wikimedia Commons for the official brand SVG. Sanitize `siteName` first — no `/` or special chars (alphanumeric + hyphens only).
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Canonical Commons API (not Wikipedia) — broadest logo coverage
|
|
30
|
+
SITE_TITLE="${siteName^}_logo.svg" # capitalize first letter: ebay → Ebay_logo.svg
|
|
31
|
+
curl -s "https://commons.wikimedia.org/w/api.php?action=query&titles=File:${SITE_TITLE}&prop=imageinfo&iiprop=url&format=json" \
|
|
32
|
+
-H "User-Agent: Mozilla/5.0" | jq -r '.query.pages | to_entries[0].value.imageinfo[0].url // empty' \
|
|
33
|
+
> /tmp/${siteName}-logo-url.txt
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If the URL is empty, try common naming variants manually:
|
|
37
|
+
- `EBay_logo.svg` (original casing), `Google_G_logo.svg`, `Reddit_logo.svg`
|
|
38
|
+
- PNG fallback via thumb endpoint: `https://upload.wikimedia.org/wikipedia/commons/thumb/.../1200px-....png`
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Download
|
|
42
|
+
curl -sL -H "User-Agent: Mozilla/5.0" "$(cat /tmp/${siteName}-logo-url.txt)" -o /tmp/${siteName}-logo.svg
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Always use `User-Agent: Mozilla/5.0`** — Wikimedia rejects empty UAs.
|
|
46
|
+
|
|
47
|
+
### 2. Pick background gradient
|
|
48
|
+
|
|
49
|
+
| Logo colors | Background |
|
|
50
|
+
|---|---|
|
|
51
|
+
| 3+ brand colors (eBay, Google) | `linear-gradient(135deg, pastel-c1, pastel-c2, …)` |
|
|
52
|
+
| 1–2 brand colors (Reddit, GitHub) | flat pastel or 2-stop gradient |
|
|
53
|
+
|
|
54
|
+
Pastel = target brand color at 10–15% saturation. Example: eBay red `#e53238` → pastel `#ffeaec`.
|
|
55
|
+
|
|
56
|
+
### 3. Compose HTML
|
|
57
|
+
|
|
58
|
+
Copy `references/banner-template.html` to `/tmp/${siteName}-banner.html`. Make three substitutions (all at once — no nested placeholders remain after this step):
|
|
59
|
+
- `{{LOGO_PATH}}` → `file:///tmp/${siteName}-logo.svg`
|
|
60
|
+
- `{{BG_GRADIENT}}` → the gradient string from step 2 (e.g. `linear-gradient(135deg, #ffeaec 0%, #e0efff 100%)`)
|
|
61
|
+
- `{{TAGLINE_BLOCK}}` → `<div class="tagline">Comp pricing · Item watchlist</div>` — substitute the literal tagline text directly, or use an empty string if no tagline
|
|
62
|
+
|
|
63
|
+
### 4. Render via Chrome headless
|
|
64
|
+
|
|
65
|
+
macOS:
|
|
66
|
+
```bash
|
|
67
|
+
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
|
|
68
|
+
--headless=new --disable-gpu --hide-scrollbars \
|
|
69
|
+
--window-size=1200,630 \
|
|
70
|
+
--screenshot=/tmp/${siteName}-banner.png \
|
|
71
|
+
file:///tmp/${siteName}-banner.html
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Linux / CI: replace with `google-chrome` or `chromium-browser` (same flags). On K8s workers, `chromium --headless=new ...` works if `chromium` is in PATH.
|
|
75
|
+
|
|
76
|
+
### 5. Upload
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
CLI confirms upload. Banner is immediately visible on trawl.me.
|
|
83
|
+
|
|
84
|
+
## Conventions
|
|
85
|
+
|
|
86
|
+
- Logo width **360px** on 1200x630 canvas (~30%). Larger overwhelms; smaller loses recognition.
|
|
87
|
+
- **Fetch the real SVG** — never recreate the wordmark in HTML/CSS. Brand fonts aren't reliably reproducible.
|
|
88
|
+
- Tagline: uppercase, `letter-spacing: 2.4px`, `color: #5a5a5a`, 22px, one line, `·` separator.
|
|
89
|
+
- Saturated gradients (not pastel) only for monochrome logos (LinkedIn blue, GitHub black).
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
| Site | Gradient | Tagline |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| eBay | `135deg, #ffeaec, #fff7e0, #e0efff, #e8f5d9` | `Comp pricing · Item watchlist` |
|
|
96
|
+
| Reddit | `135deg, #fff1ec, #fff8f5` | `Subreddit pulse · Post discussions` |
|
|
97
|
+
| GitHub | `135deg, #f5f5f5, #e8e8e8` | `Repo stats · Trending discovery` |
|
|
98
|
+
|
|
99
|
+
## What this skill does NOT cover
|
|
100
|
+
|
|
101
|
+
- Scrap script → `trawl-scrap-design`
|
|
102
|
+
- CLI account management → `trawl-cli`
|