Skip to content

Instantly share code, notes, and snippets.

@dpk
Created April 11, 2011 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpk/913932 to your computer and use it in GitHub Desktop.
Save dpk/913932 to your computer and use it in GitHub Desktop.
The usage of Plan's Atom feed generator, based on Rails' atom_feed Builder handler. It works by generating SXML which is then turned into the actual XML of the feed.
(atom-feed
(title "David's Weblog")
(subtitle "An awesome weblog")
(link 'self "http://dpk.org.uk/feed/")
(each post (posts 20)
(entry
(title (post 'title)) ; maybe do an automagic thing to detect dictionary items with the same name as atom properties?
(id (tag-uri post))
(link 'alternate (post 'permalink)) ; could be automagic, too
(published (post 'pub-date)) ; automagic?
(updated (post 'upd-date)) ; " ?
(author '(name "David Kendal"))
(content (post 'body)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment