fix(feeds): replace 25 dead/stale RSS URLs and add feed validation script#455
fix(feeds): replace 25 dead/stale RSS URLs and add feed validation script#455
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 990b279447
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
scripts/validate-rss-feeds.mjs
Outdated
| // Match rss('url') or railwayRss('url') — capture raw URL | ||
| const rssUrlRe = /(?:rss|railwayRss)\(\s*'([^']+)'\s*\)/g; | ||
| // Match name: 'X' or name: "X" (Tom's Hardware uses double quotes) | ||
| const nameRe = /name:\s*(?:'([^']+)'+|"([^"]+)")/; |
There was a problem hiding this comment.
Handle escaped apostrophes when parsing feed names
The nameRe regex (/name:\s*(?:'([^']+)'+|"([^"]+)")/) treats escaped apostrophes as string terminators, so names like L\'Orient-Le Jour and Lenny\'s Newsletter are parsed as L\ and Lenny\ instead of full names. In this script the parsed name feeds into both reporting and the dedupe key (${label}|${rawUrl}), so malformed names can produce misleading validation output and inaccurate deduplication.
Useful? React with 👍 / 👎.
nameRe used [^']+ which stopped at \' in source text, truncating names like L'Orient-Le Jour to "L\" and Lenny's Newsletter to "Lenny\". Use (?:[^'\\]|\\.)* to skip escape sequences. Also removed stray + quantifier after closing quote.
a68dcdd to
032b2f4
Compare
nameRe used [^']+ which stopped at \' in source text, truncating names like L'Orient-Le Jour to "L\" and Lenny's Newsletter to "Lenny\". Use (?:[^'\\]|\\.)* to skip escape sequences. Also removed stray + quantifier after closing quote.
Summary
scripts/validate-rss-feeds.mjsvalidation script to detect broken feedsTest plan
npm run dev— verify news panels load without RSS errorsnode scripts/validate-rss-feeds.mjs— all feeds return 200