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

FR: With items with no link but an enclosure with a href, use that href for entries[i].link #384

Open
melyux opened this issue Jul 22, 2023 · 1 comment

Comments

@melyux
Copy link

melyux commented Jul 22, 2023

For example, there is a popular podcast website Buzzsprout that uses Atom for its feeds. Each item has no link but only an enclosure.

Here's an example feed:

...
  <item>
    <itunes:title>With Nick van der Kolk from Love + Radio #17</itunes:title>
    <title>With Nick van der Kolk from Love + Radio #17</title>
    <description>...</description>
    <content:encoded>...</content:encoded>
    <itunes:author>Andy Clark en Richard den Haring</itunes:author>
    <enclosure url="https://www.buzzsprout.com/99850/2968933-with-nick-van-der-kolk-from-love-radio-17.mp3" length="20004212" type="audio/mpeg" />
    <guid isPermaLink="false">Buzzsprout-2968933</guid>
    <pubDate>Tue, 10 Mar 2020 02:00:00 -0400</pubDate>
    <itunes:duration>1665</itunes:duration>
    <itunes:keywords></itunes:keywords>
    <itunes:episodeType>bonus</itunes:episodeType>
    <itunes:explicit>false</itunes:explicit>
  </item>
...

Since there is no link but a single enclosure with a URL, this can be used as the definitive entries[i].link for this entry. This would parallel how both the <link> and enclosures are mixed together to produce entries[i].links.

If there is more than 1 enclosure with a URL, then we can fall back to the current thing since we have no way of knowing which URL would be the primary. But in this case with a single URL, it's clear.

@melyux
Copy link
Author

melyux commented Jul 22, 2023

P.S. Saw that <link> becomes an entries[i].links element with rel set to alternate even though the link doesn't have that rel set. Not familiar with the Atom spec too well, is this how it's supposed to be? Or should it default to another rel type like self?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant