Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepage: enable atom feeds #13806

Merged
merged 3 commits into from
Sep 6, 2024
Merged

Homepage: enable atom feeds #13806

merged 3 commits into from
Sep 6, 2024

Conversation

wackerow
Copy link
Member

@wackerow wackerow commented Sep 5, 2024

Extends homepage branch found in:

Description

  • Add support for atom feeds
  • Activate PSE and Josh Stark feeds which were pending this upgrade
image

Related Issue

Homepage epic

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Sep 5, 2024
Always check for possible string value first before AtomElement struct
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const [source] = mainChannel.title
const [sourceUrl] = mainChannel.link
const channelImage = mainChannel.image ? mainChannel.image[0].url[0] : ""
const response = (await fetchXml(url)) as RSSResult | AtomResult
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocker: instead of casting the type you could use type guards

const isRSSFeed = (result: Record<string, unknown>): result is RSSResult => {
  return "rss" in result
}

const response = await fetchXml(url)

if (isRSSFeed(response)) {
  const parsedRssItems = parseRSSItem(...)
}
...

@pettinarip pettinarip merged commit 4d13857 into homepage Sep 6, 2024
2 checks passed
@pettinarip pettinarip deleted the homepage-atom-feed branch September 6, 2024 09:00
This was referenced Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants