fix rss: support rel=self and XML content-type feeds#14
Open
carlotran4 wants to merge 3 commits intoHyaxia:mainfrom
Open
fix rss: support rel=self and XML content-type feeds#14carlotran4 wants to merge 3 commits intoHyaxia:mainfrom
carlotran4 wants to merge 3 commits intoHyaxia:mainfrom
Conversation
added 3 commits
April 2, 2026 03:17
- Check content-type header: if URL returns rss/atom/xml, use it directly This fixes feeds that return XML instead of HTML (e.g. TechCrunch tag feeds) - Also check rel="self" in addition to rel="alternate" for feeds that use self-referencing links
- Use mime.ParseMediaType for content-type parsing (handles params/case) - Only accept explicit feed types in content-type (avoid sitemap false positives) - Use [rel~='value'] token matching for rel attributes - Use [type~='value'] for case-insensitive type matching Suggested by Codex review.
JulienTant
added a commit
to JulienTant/blogwatcher-cli
that referenced
this pull request
Apr 3, 2026
DiscoverFeedURL now handles two additional cases: 1. When a URL already returns a feed content-type (application/rss+xml, application/atom+xml, or application/feed+json), return it directly instead of trying to parse HTML. 2. When HTML pages use rel="self" instead of rel="alternate" for their feed link tags, check both attributes. This fixes discovery for feeds like TechCrunch tag/category feeds which return XML directly and may use rel="self" links. Based on upstream PR #14 by @carlotran4 (Hyaxia/blogwatcher#14), adapted to our fork's patterns (context threading, testify, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
JulienTant
added a commit
to JulienTant/blogwatcher-cli
that referenced
this pull request
Apr 3, 2026
DiscoverFeedURL now handles two additional cases: 1. When a URL already returns a feed content-type (application/rss+xml, application/atom+xml, or application/feed+json), return it directly instead of trying to parse HTML. 2. When HTML pages use rel="self" instead of rel="alternate" for their feed link tags, check both attributes. This fixes discovery for feeds like TechCrunch tag/category feeds which return XML directly and may use rel="self" links. Based on upstream PR #14 by @carlotran4 (Hyaxia/blogwatcher#14), adapted to our fork's patterns (context threading, testify, etc.). 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.
Fixes DiscoverFeedURL to handle two cases:
XML content-type: When a URL already returns RSS/Atom/XML (e.g.
techcrunch.com/tag/AI/feed/), use it directly instead of trying to parse HTML.rel="self" links: Some feeds use
rel="self"instead ofrel="alternate"in their HTML. Now checks both.This fixes TechCrunch tag/category feeds which return XML directly and use
rel="self"links.Before:
DiscoverFeedURLwould fall back to/feedfor TechCrunch tag feeds.After: Correctly returns the tag feed URL.