From 789cc616a95f8ab841df5a007cf1115f9d63117f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 21 Apr 2021 12:47:46 +0200 Subject: add support for old/legacy Atom 0.3 feeds This standard was a draft used around 2005-2006. Instead of the fields "published" and "updated" it used "issued" (mandatory field) and "modified" (optional). Add support for them and also in preference of supporting Atom 1.0 and creation dates first. I don't know any real-life examples that still use this though. Some references: - http://rakaz.nl/2005/07/moving-from-atom-03-to-10.html - https://www.dokuwiki.org/syndication (rss_type "atom" parameter value). - https://support.google.com/merchants/answer/160598?hl=en --- sfeed.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sfeed.c b/sfeed.c index 76b423f..865c6ff 100644 --- a/sfeed.c +++ b/sfeed.c @@ -58,7 +58,8 @@ enum TagId { RSSTagAuthor, RSSTagDccreator, RSSTagCategory, /* Atom */ - AtomTagUpdated, AtomTagPublished, /* creation date has higher priority */ + /* creation date has higher priority */ + AtomTagModified, AtomTagUpdated, AtomTagIssued, AtomTagPublished, AtomTagTitle, AtomTagMediaDescription, AtomTagSummary, AtomTagContent, AtomTagId, @@ -151,9 +152,11 @@ static FeedTag atomtags[] = { { STRP("category"), AtomTagCategory }, { STRP("content"), AtomTagContent }, { STRP("id"), AtomTagId }, + { STRP("issued"), AtomTagIssued }, /* Atom 0.3 */ /* Atom: , RSS has */ { STRP("link"), AtomTagLink }, { STRP("media:description"), AtomTagMediaDescription }, + { STRP("modified"), AtomTagModified }, /* Atom 0.3 */ { STRP("published"), AtomTagPublished }, { STRP("summary"), AtomTagSummary }, { STRP("title"), AtomTagTitle }, @@ -186,7 +189,9 @@ static int fieldmap[TagLast] = { [RSSTagDccreator] = FeedFieldAuthor, [RSSTagCategory] = FeedFieldCategory, /* Atom */ + [AtomTagModified] = FeedFieldTime, [AtomTagUpdated] = FeedFieldTime, + [AtomTagIssued] = FeedFieldTime, [AtomTagPublished] = FeedFieldTime, [AtomTagTitle] = FeedFieldTitle, [AtomTagMediaDescription] = FeedFieldContent, -- cgit v1.2.3