Skip to content

Commit d7d94bd

Browse files
committed
feat: implement website app extractor with metadata, icons, and screenshot functionality
1 parent 9ee715e commit d7d94bd

4 files changed

Lines changed: 732 additions & 0 deletions

File tree

.claude/agents/extract-app.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: extract-app
3+
description: Extract app metadata, icons, and screenshot from a website URL
4+
---
5+
6+
Extract comprehensive app information from the provided website URL and create a properly formatted JSON file for the free-the-web-apps project.
7+
8+
## Process:
9+
10+
1. **Fetch the website HTML** and extract:
11+
- Title
12+
- Description (from meta tags)
13+
- Open Graph data
14+
- Icons (favicon, apple-touch-icon, manifest icons)
15+
- PWA manifest if available
16+
17+
2. **Analyze the website** to determine:
18+
- Clean app name (remove suffixes like "- Home")
19+
- Concise description (max 100 characters)
20+
- Relevant tags from tags.json
21+
- Primary category
22+
23+
3. **Download assets**:
24+
- Create directory: `public/icons/{app-id}/`
25+
- Download the best available icon as `regular.png`
26+
- Copy to `mac.png` (or download specific mac icon if different)
27+
- Use absolute URLs: `https://ftwa.mathix.dev/icons/{app-id}/`
28+
29+
4. **Take screenshot**:
30+
- Use Playwright or similar to capture at 1428x960
31+
- Save to `public/screenshot/{app-id}.png`
32+
- Use relative path in JSON: `/screenshot/{app-id}.png`
33+
34+
5. **Generate JSON file**:
35+
```json
36+
{
37+
"id": "app-id",
38+
"name": "App Name",
39+
"description": "Concise description",
40+
"url": "https://example.com",
41+
"logo": "https://ftwa.mathix.dev/icons/app-id/regular.png",
42+
"macLogo": "https://ftwa.mathix.dev/icons/app-id/mac.png",
43+
"screenshot": "/screenshot/app-id.png",
44+
"tags": ["relevant", "tags"],
45+
"logoSize": 512
46+
}
47+
```
48+
49+
6. **Save as** `content/{app-id}.json` (no number prefix)
50+
51+
## Instructions:
52+
53+
When the user provides a URL:
54+
1. Run the extract-app.js script if it exists
55+
2. Or manually perform the extraction steps above
56+
3. Use your best judgment to categorize and tag the app
57+
4. Ensure all URLs and paths follow the project conventions
58+
5. Update tags.json if new tags are needed
59+
60+
## Example usage:
61+
```
62+
/extract-app https://excalidraw.com
63+
```
64+
65+
This will extract all information from Excalidraw and create the necessary files.

bun.lockb

29 KB
Binary file not shown.

0 commit comments

Comments
 (0)