Building
Building entries and feeds is simple:
require "atom/feed" e = Atom::Entry.new e.title = "a new entry" e.content = "some <em>boring</em> HTML" e.content.type = "html" e.categories.new :term => "Test Entry" feed = Atom::Feed.new feed << e feed.to_s # => "<feed xmlns='http://www.w3.org/2005/Atom'><entry><title>a new entry</title><content type='html'>some <em>boring</em> HTML</content><category term='Test Entry'/></entry></feed>"
atom-tools won't complain if you've forgotten to include all the bits you need, so you should run the final product through the Feed Validator before you publish.
Parsing
require "atom/feed" f = Atom::Feed.new("http://www.tbray.org/ongoing/ongoing.atom") f.entries # => [] f.update! f.entries # => [#<Atom::Entry>, ...] f.entries.first.title.to_s # => "Tag Scheme?"
More Complex Things
- two simple AtomPublishingProtocol servers by Simon Rozet (implemented in Camping and Mongrel)
- source:bin/atom-cp -- an AtomPublishingProtocol? client that can copy entries from one feed to another
- VoxApi -- faking the Atom API
- HtmlToXhtml -- convert @type='html' to @type='xhtml'
