<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h2&gt;Building&lt;/h2&gt;
&lt;p&gt;Building entries and feeds is simple:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!ruby
require &quot;atom/feed&quot;

e = Atom::Entry.new
e.title = &quot;a new entry&quot;

e.content = &quot;some &amp;lt;em&amp;gt;boring&amp;lt;/em&amp;gt; HTML&quot;
e.content.type = &quot;html&quot;

e.categories.new :term =&amp;gt; &quot;Test Entry&quot;

feed = Atom::Feed.new

feed &amp;lt;&amp;lt; e
feed.to_s
# =&amp;gt; &quot;&amp;lt;feed xmlns='http://www.w3.org/2005/Atom'&amp;gt;&amp;lt;entry&amp;gt;&amp;lt;title&amp;gt;a new entry&amp;lt;/title&amp;gt;&amp;lt;content type='html'&amp;gt;some &amp;amp;lt;em&amp;amp;gt;boring&amp;amp;lt;/em&amp;amp;gt; HTML&amp;lt;/content&amp;gt;&amp;lt;category term='Test Entry'/&amp;gt;&amp;lt;/entry&amp;gt;&amp;lt;/feed&amp;gt;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;atom-tools won&amp;#8217;t complain if you&amp;#8217;ve forgotten to include all the bits you need, so you should run the final product through &lt;a href=&quot;http://feedvalidator.org/&quot;&gt;the Feed Validator&lt;/a&gt; before you publish.&lt;/p&gt;
&lt;h2&gt;Parsing&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;#!ruby
require &quot;atom/feed&quot;

f = Atom::Feed.new(&quot;http://www.tbray.org/ongoing/ongoing.atom&quot;)

f.entries
# =&amp;gt; []

f.update!
f.entries
# =&amp;gt; [#&amp;lt;Atom::Entry&amp;gt;, ...]

f.entries.first.title.to_s
# =&amp;gt; &quot;Tag Scheme?&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;More Complex Things&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://github.com/sr&quot;&gt;Simon Rozet&lt;/a&gt; has written several simple Atom Publishing Protocol servers&lt;/li&gt;
	&lt;li&gt;atom-tools/bin/atom-cp &amp;#8212; an Atom Publishing Protocol client that can copy entries from one feed to another&lt;/li&gt;
	&lt;li&gt;[[VoxApi]] &amp;#8212; faking the Atom &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;[[HtmlToXhtml]] &amp;#8212; convert @type=&amp;#8216;html&amp;#8217; to @type=&amp;#8216;xhtml&amp;#8217;&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2008-10-17T13:25:10-07:00</created-at>
  <id type="integer">68513</id>
  <permalink>examplecode</permalink>
  <repository-id type="integer">64242</repository-id>
  <title>ExampleCode</title>
  <updated-at type="datetime">2008-10-17T13:27:16-07:00</updated-at>
  <user-id type="integer">548</user-id>
</wiki>
