diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-04-21 12:47:46 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2021-04-28 18:26:57 +0200 |
commit | 789cc616a95f8ab841df5a007cf1115f9d63117f (patch) | |
tree | 1ed434bf9a2cb5568972ec814ada22fecade24e7 | |
parent | bb3aa63579c2282db6234fcc95b0f7ed7d71cd25 (diff) |
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
-rw-r--r-- | sfeed.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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: <link href="" />, RSS has <link></link> */ { 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, |