aigents / aigents-java

Aigents Java Core Platform
MIT License
29 stars 12 forks source link

Improve purity of RSS format #3

Open akolonin opened 4 years ago

akolonin commented 4 years ago

Based on warnings seen in https://validator.w3.org/feed/

line 13, column 4: Missing enclosure attribute: length (7 occurrences) [help] <enclosure url="https://www.youtube.com/yts/img/pixel-vfl3z5WfW.gif" typ ... line 13, column 4: type attribute of enclosure must be a valid MIME type (7 occurrences) [help] <enclosure url="https://www.youtube.com/yts/img/pixel-vfl3z5WfW.gif" typ ...

Need to EITHER A) identify size and mime type of the enclosed image properly (see https://stackoverflow.com/questions/705224/how-do-i-add-an-image-to-an-item-in-rss-2-0 saying "The length attribute doesn't need to be completely accurate but it's required for the RSS to be considered valid") OR B) include image as <img ... /> tag in the having the content of the description framed into ![CDATA[...]], like ![CDATA[<img src="https://my.site.com/my_image.jpg"]]My text (see https://www.aitrends.com/feed/ for example)

line 17, column 2: item should contain a guid element (13 occurrences) [help]

Need to have every news item to have a guid (better being a permlink) associated with a feed, like

https://www.aitrends.com/?p=18403

line 132, column 0: Missing atom:link with rel="self" [help]

Need to have RSS feed url to be part of the feed channel, like: <?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"

...

See https://www.aitrends.com/feed/ for example.