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

Support for URLs in GUIDs. #420

Merged
merged 1 commit into from
Sep 24, 2019
Merged

Support for URLs in GUIDs. #420

merged 1 commit into from
Sep 24, 2019

Conversation

benubois
Copy link
Contributor

Hi,

I came across a feed that uses only <guid isPermaLink="true"> tags to specify URLs.

This pull request adds support for this type of url.

According to the RSS 2.0 spec:

  • If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item
  • isPermaLink is optional, its default value is true

My interpretation is that the <guid> is supposed to be the url of the entry, unless isPermaLink="false" is specified.

To ensure the output is as consistent with previous releases as possible, this patch also prefers urls specified in <link> tags when both a <guid> and <link> are present.

Thanks!

@HParker
Copy link
Member

HParker commented Jul 10, 2019

Thanks for this @benubois Unfortunately, I just merged a PR that moves this code since it is shared between a couple feed types. I'll try to manually apply this change, but if you resolve the conflicts before I can do that, I won't be sad. 😄

def id
@entry_id ||= @dc_identifier || @url
entry_id || @dc_identifier || @url
Copy link
Member

Choose a reason for hiding this comment

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

These lines now belong to lib/feedjira/rss_entry_utilities.rb, so please merge (or rebase onto) master and apply the change to it.

Use the presence of the isPermaLink attribute to determine if the GUID
should be used for the URL.
Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

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

Looks good!

@knu knu merged commit 93daee8 into feedjira:master Sep 24, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants