PocketBase view collection benutzen. Dokumentation aktualisieren.

This commit is contained in:
2026-07-14 20:06:19 +02:00
parent a1504dd5e6
commit b8b4e00b92
10 changed files with 162 additions and 138 deletions

18
PLAN.md
View File

@@ -8,8 +8,8 @@ story names and how recently each was updated.
## Behavior
1. Authenticate to PocketBase using credentials baked in at compile time.
2. Query the `bookmarks` collection, filtering `category = "Geschichten"`.
1. Read the collection endpoint URL baked in at compile time.
2. Query the `storyurls` collection. All rows are valid; no filtering needed.
3. Extract the `url` field from each matching record.
4. For each URL, sequentially fetch the RoyalRoad fiction page.
5. Extract the fiction name and `dateModified` from the embedded JSON-LD
@@ -34,7 +34,7 @@ story names and how recently each was updated.
| Scenario | Behaviour |
|----------|-----------|
| PocketBase unreachable or auth fails | Exit code ≠ 0, error message on stderr |
| PocketBase unreachable or fetch fails | Exit code ≠ 0, error message on stderr |
| Zero valid RoyalRoad stories found after filtering | Exit code 0, empty table |
| Individual RoyalRoad page fails to fetch or parse | Silent skip (no output, no error) |
@@ -56,16 +56,13 @@ the standard library.
## Compile-Time Configuration
The three PocketBase connection values are compiled into the binary via `-ldflags`:
The collection endpoint URL is compiled into the binary via `-ldflags`:
```
PB_URL=https://pocketbase.example.com
PB_USER=username
PB_PASSWORD=password
PBURL=https://example.com/api/collections/storyurls/records
```
These are read from a `.env` file at build time. The resulting binary runs
standalone without any environment variables present.
This is read from the `.env` file at build time. The `.env` key is `PB_URL`; the Makefile passes its value via `-ldflags "-X main.PBURL=${PB_URL}"`.
## Output Formats
@@ -98,8 +95,7 @@ Dates are always sortable ISO 8601 / RFC3339 strings in JSON output.
## Data Flow
```
PocketBase (bookmarks collection)
└── Filter: category = "Geschichten"
PocketBase (storyurls collection)
└── Extract: url field
└── For each URL:
├── Skip if not royalroad.com