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

Produced feed is not valid when entry has header image #92

Closed
sterago opened this issue Feb 10, 2017 · 3 comments
Closed

Produced feed is not valid when entry has header image #92

sterago opened this issue Feb 10, 2017 · 3 comments

Comments

@sterago
Copy link
Contributor

sterago commented Feb 10, 2017

it seems that because of this method https://github.com/APSL/puput/blob/master/puput/feeds.py#L48

the produced RSS feed contains an enclosure element, which is invalid because it's lacking the length and type fields which are required (https://validator.w3.org/feed/docs/rss2.html)

To my understanding the enclosure element is only useful for media that has a length, e.g. audio or video, but not for images, therefore my proposed solution would be to remove this method altogether.

I can work on a PR if this sounds reasonable

@marctc
Copy link
Collaborator

marctc commented Feb 11, 2017

So, where will header image go if we remove enclosure?

@sterago
Copy link
Contributor Author

sterago commented Feb 13, 2017

Apparently, the two most common ways of including an image for a feed's item are:

  • adding the image within an enclosure element
  • adding a CDATA section with an img element inside of the item's description field

However, for the first alternative one would need to specify the MIME type, which given the current implementation, results in a "None" value, and a valid length which is currently None, and in the case of an image should be the size of the file.

The second alternative, instead, allows to just specify the image's source URL without having to worry about the length of the file, whose calculation might require additional processing.

I can implement any of the two. What do you think @marctc ?

@marctc
Copy link
Collaborator

marctc commented Feb 13, 2017

To be honest, I don't have the enough RSS knowledge to make this decission. So if any of the implementations work choose whatever solution you think will work better.

thanks!

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

2 participants