<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: application/atom+json</title>
	<link>http://smackman.com/2006/05/08/applicationatomjson/</link>
	<description>Putting the smack down, one smack at a time</description>
	<pubDate>Mon, 06 Sep 2010 10:32:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Dennis</title>
		<link>http://smackman.com/2006/05/08/applicationatomjson/#comment-6</link>
		<pubDate>Fri, 12 May 2006 04:48:38 +0000</pubDate>
		<guid>http://smackman.com/2006/05/08/applicationatomjson/#comment-6</guid>
					<description>Wordpress stripped out some of my Atom code.

&quot;Gibberish
Code&quot;

Should be:
&amp;#60;dc:subject&amp;#62;Gibberish&amp;#60;/dc:subject&amp;#62;
&amp;#60;dc:subject&amp;#62;Code&amp;#60;/dc:subject&amp;#62;

Hopefully this will work.</description>
		<content:encoded><![CDATA[<p>Wordpress stripped out some of my Atom code.</p>
<p>&#8220;Gibberish<br />
Code&#8221;</p>
<p>Should be:<br />
&lt;dc:subject&gt;Gibberish&lt;/dc:subject&gt;<br />
&lt;dc:subject&gt;Code&lt;/dc:subject&gt;</p>
<p>Hopefully this will work.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Dennis</title>
		<link>http://smackman.com/2006/05/08/applicationatomjson/#comment-5</link>
		<pubDate>Fri, 12 May 2006 04:43:09 +0000</pubDate>
		<guid>http://smackman.com/2006/05/08/applicationatomjson/#comment-5</guid>
					<description>I just spent couple of minutes and looked in the MagpieRSS source code.  I see what you are talking about.

This chunk of code in rss_parse.inc seems to explain the problem.

// if inside an Atom content construct (e.g. content or summary) field treat tags as text
elseif ($this-&amp;#62;feed_type == ATOM and $this-&amp;#62;incontent ) 
        {
            // if tags are inlined, then flatten
            $attrs_str = join(' ', 
                    array_map('map_attrs', 
                    array_keys($attrs), 
                    array_values($attrs) ) );
            
            $this-&amp;#62;append_content( &quot;&quot;  );
                    
            array_unshift( $this-&amp;#62;stack, $el );
}

The PHP code takes the below Atom data:
Gibberish
Code 

And turns it in to (output as JSON):
&quot;dc&quot;:{&quot;subject&quot;:&quot;GibberishCode&quot;}

Which I agree is not a good solution, and would go as far as saying that it is just wrong.  Flattening the data structure destroys a lot of the stored information (which does not have to happen).

I can see at least one solution off the top of my head, but I do not know the ramifications of the modifications without studying the library a good bit more.</description>
		<content:encoded><![CDATA[<p>I just spent couple of minutes and looked in the MagpieRSS source code.  I see what you are talking about.</p>
<p>This chunk of code in rss_parse.inc seems to explain the problem.</p>
<p>// if inside an Atom content construct (e.g. content or summary) field treat tags as text<br />
elseif ($this-&gt;feed_type == ATOM and $this-&gt;incontent )<br />
        {<br />
            // if tags are inlined, then flatten<br />
            $attrs_str = join(&#8217; &#8216;,<br />
                    array_map(&#8217;map_attrs&#8217;,<br />
                    array_keys($attrs),<br />
                    array_values($attrs) ) );</p>
<p>            $this-&gt;append_content( &#8220;&#8221;  );</p>
<p>            array_unshift( $this-&gt;stack, $el );<br />
}</p>
<p>The PHP code takes the below Atom data:<br />
Gibberish<br />
Code </p>
<p>And turns it in to (output as JSON):<br />
&#8220;dc&#8221;:{&#8221;subject&#8221;:&#8221;GibberishCode&#8221;}</p>
<p>Which I agree is not a good solution, and would go as far as saying that it is just wrong.  Flattening the data structure destroys a lot of the stored information (which does not have to happen).</p>
<p>I can see at least one solution off the top of my head, but I do not know the ramifications of the modifications without studying the library a good bit more.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: steve</title>
		<link>http://smackman.com/2006/05/08/applicationatomjson/#comment-3</link>
		<pubDate>Tue, 09 May 2006 14:31:37 +0000</pubDate>
		<guid>http://smackman.com/2006/05/08/applicationatomjson/#comment-3</guid>
					<description>Thanks Dennis -- Actually, it was writing the same PHP script (with Magpie and JSON, but not quite as clean as yours) that lead me to write my post.  The problem with this approach is that the schema is reflective of Magpie's internal data structures which I think are lossy (they don't preserve everything from the atom feed, but convert it to a lowest common denominator of atom and rss) and are non standard.  I should be able to get an atom+json feed from most sites that already support atom+xml and rely on its structure.

James Snell (also at IBM) has agreed to work on this with me... hopefully we'll have an IETF draft soon.</description>
		<content:encoded><![CDATA[<p>Thanks Dennis &#8212; Actually, it was writing the same PHP script (with Magpie and JSON, but not quite as clean as yours) that lead me to write my post.  The problem with this approach is that the schema is reflective of Magpie&#8217;s internal data structures which I think are lossy (they don&#8217;t preserve everything from the atom feed, but convert it to a lowest common denominator of atom and rss) and are non standard.  I should be able to get an atom+json feed from most sites that already support atom+xml and rely on its structure.</p>
<p>James Snell (also at IBM) has agreed to work on this with me&#8230; hopefully we&#8217;ll have an IETF draft soon.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Dennis</title>
		<link>http://smackman.com/2006/05/08/applicationatomjson/#comment-2</link>
		<pubDate>Tue, 09 May 2006 01:43:04 +0000</pubDate>
		<guid>http://smackman.com/2006/05/08/applicationatomjson/#comment-2</guid>
					<description>I wrote up a script to convert different feeds (RSS, Atom) to JSON.  You might find it interesting.

Write-up:
http://www.engrowe.com/2006/05/08/how-to-convert-a-rss-feed-to-json-in-php/

Atom Example:
http://www.engrowe.com/rsstojson.php?feed=http://www.engrowe.com/?feed=atom&amp;#38;callback=rss_read</description>
		<content:encoded><![CDATA[<p>I wrote up a script to convert different feeds (RSS, Atom) to JSON.  You might find it interesting.</p>
<p>Write-up:<br />
<a href='http://www.engrowe.com/2006/05/08/how-to-convert-a-rss-feed-to-json-in-php/' rel='nofollow'>http://www.engrowe.com/2006/05/08/how-to-convert-a-rss-feed-to-json-in-php/</a></p>
<p>Atom Example:<br />
<a href='http://www.engrowe.com/rsstojson.php?feed=http://www.engrowe.com/?feed=atom&amp;callback=rss_read' rel='nofollow'>http://www.engrowe.com/rsstojson.php?feed=http://www.engrowe.com/?feed=atom&amp;callback=rss_read</a>
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
