summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2021-04-21 12:47:46 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-04-28 18:26:57 +0200
commit789cc616a95f8ab841df5a007cf1115f9d63117f (patch)
tree1ed434bf9a2cb5568972ec814ada22fecade24e7 /sfeed.c
parentbb3aa63579c2282db6234fcc95b0f7ed7d71cd25 (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
Diffstat (limited to 'sfeed.c')
-rw-r--r--sfeed.c7
1 files changed, 6 insertions, 1 deletions
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: <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,