diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-27 15:05:36 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-27 17:21:45 -0500 |
| commit | 200defaa5c769b4603f9256e943821344cadbe82 (patch) | |
| tree | c66bc43948d8accf8cd2d5462c6115c8cc238ca7 /CLAUDE.md | |
| parent | 8fec0b99fbe193326d25fc107e0c625dcf05fd12 (diff) | |
List issues
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -1,10 +1,6 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - ## Project Overview -cgithub is a lightweight GitHub alternative frontend that scrapes GitHub's server-rendered HTML instead of using the API. This approach avoids API rate limits entirely by extracting embedded JSON data from `<script type="application/json">` tags that GitHub includes for hydration. +cgithub is a lightweight GitHub alternative frontend that scrapes GitHub's server-rendered HTML instead of using the API. Data is usually extracted from embedded JSON data from `<script type="application/json">` tags that GitHub includes for hydration. ## Commands @@ -15,8 +11,8 @@ pnpm run dev # Production build (bundles to dist/) pnpm run build -# Deploy to production server -make deploy +# Run tests +pnpm test ``` ## Architecture @@ -30,13 +26,11 @@ make deploy **Templates:** `views/*.eta` - Eta templates with layout inheritance (`layout.eta` as base) **Routes:** -- `GET /` - Home page - `GET /:owner/:repo` - Repository info with directory listing - `GET /:owner/:repo/tree/:branch/:path*` - Directory listing - `GET /:owner/:repo/blob/:branch/:path` - File content view -**Scraper pattern:** GitHub embeds tree/blob data in two formats depending on page type: -- `react-partial.embeddedData` (props.initialPayload) for root directories -- `react-app.embeddedData` (payload) for subdirectories and blobs +## Instructions -The scraper uses browser-like headers to avoid throttling. +- Use `for (const ... of ...)` instead of `.forEach()` +- Update `scraper.test.ts`
\ No newline at end of file |
