feat: add category support for RSS articles#11
Open
weronikakombat wants to merge 1 commit intoHyaxia:mainfrom
Open
feat: add category support for RSS articles#11weronikakombat wants to merge 1 commit intoHyaxia:mainfrom
weronikakombat wants to merge 1 commit intoHyaxia:mainfrom
Conversation
- Add Categories field to Article model - Extract categories from RSS/Atom feeds using gofeed - Store categories as comma-separated in database - Add migration for existing databases - Add --category flag to articles command - Display categories in article list output
JulienTant
added a commit
to JulienTant/blogwatcher-cli
that referenced
this pull request
Apr 3, 2026
Parse and store categories/tags from RSS and Atom feeds, with a new --category flag on the articles command to filter by category. Inspired by Hyaxia/blogwatcher#11 (by @weronikakombat). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
JulienTant
added a commit
to JulienTant/blogwatcher-cli
that referenced
this pull request
Apr 4, 2026
* Add SSRF-safe HTTP client with --unsafe-client escape hatch - Use DataDog go-secure-sdk for SSRF protection (blocks private IPs, loopback, link-local, cloud metadata endpoints) - Refactor rss.Fetcher and scraper.Scraper as structs holding *http.Client - Scanner accepts Fetcher + Scraper as dependencies (no global state) - Add --unsafe-client / BLOGWATCHER_UNSAFE_CLIENT flag for local dev - ScanBlog now returns error (hard fail, not soft error string) - E2e test verifies safe client blocks loopback requests - Tests use plain http.Client (no SSRF check needed for httptest) - Update AGENTS.md: ground claims in evidence, not guesses Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add category support for RSS/Atom feed articles Parse and store categories/tags from RSS and Atom feeds, with a new --category flag on the articles command to filter by category. Inspired by Hyaxia/blogwatcher#11 (by @weronikakombat). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix review findings and add category e2e tests - Only persist discovered feed URL after ParseFeed succeeds - Fix category LIKE query to use delimited matching (prevents "AI" matching "FAIR") - Replace scanner worker pool with errgroup to prevent deadlock - Add categories to GitHub RSS fixture and e2e test for --category filter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix test compatibility with Fetcher struct API Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Store categories as JSON array instead of comma-separated string - Use json.Marshal/Unmarshal for categories serialization - Query with json_each() for exact element matching instead of LIKE Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Case-insensitive category filtering with LOWER() + test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Propagate JSON serialization errors in category helpers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10
This PR adds support for storing and filtering articles by categories/tags from RSS/Atom feeds.
Changes
Model (
internal/model/model.go)Categories []stringfield toArticlestructRSS Parser (
internal/rss/rss.go)Categories []stringtoFeedArticlestructitem.Categoriesfrom gofeed when parsing feedsStorage (
internal/storage/database.go)categoriescolumn to articles table in schemamigrate()function to handle existing databases (backward compatible)categoriesToString()andcategoriesFromString()helpersListArticles()now accepts optional category filter parameterScanner (
internal/scanner/scanner.go)convertFeedArticles()Controller (
internal/controller/controller.go)GetArticles()to accept category parameterCLI (
internal/cli/commands.go)--category/-cflag toarticlescommandUsage Examples
Backward Compatibility
migrate()functionTesting
All existing tests pass. The PR touches:
internal/model/model.gointernal/rss/rss.gointernal/storage/database.go+ testsinternal/scanner/scanner.go+ testsinternal/controller/controller.go+ testsinternal/cli/commands.goI'm happy to address any feedback!