- (cond
- ((null author) `(author nil
- (name nil ,user-full-name)
- (email nil ,user-mail-address)))
- ((stringp author) `(author nil
- (name nil ,user-full-name)))
- ((= 2 (length author)) `(author nil (name nil ,(car author))
- (email nil ,(cadr author))))
- (t `(author nil ,author))))
+ `(nil ,@(cond
+ ((null author) `((name nil ,user-full-name)
+ (email nil ,user-mail-address)))
+ ((stringp author) `((name nil ,author)))
+ ((= 2 (length author)) `((name nil ,(car author))
+ (email nil ,(cadr author))))
+ (t `(author nil ,author)))))
+
+(require 'url-parse)
+
+(defun atom-generate-id (link creation-date)
+ "Generate a string suitable for use as an atom:id element. This
+implements Mark Pilgrom's tag: URI method, using the
+CREATION-DATE of the entry, and the domain part of LINK."
+ (format "tag:%s,%s:/%s"
+ (url-host (url-generic-parse-url link))
+ (format-time-string "%Y-%m-%d" creation-date)
+ (format-time-string "%Y%m%d%H%M%S" creation-date)))