This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
ExampleCode
Building
Building entries and feeds is simple:
#!ruby
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
#!ruby
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
- Simon Rozet has written several simple Atom Publishing Protocol servers
- atom-tools/bin/atom-cp—an Atom Publishing Protocol client that can copy entries from one feed to another
- VoxApi—faking the Atom API
- HtmlToXhtml—convert @type=’html’ to @type=’xhtml’











