<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rants of a mobile dev &#187; Api</title>
	<atom:link href="http://blog.smartcube.co.za/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartcube.co.za</link>
	<description>Mobile developer ranting about mobile stuff</description>
	<lastBuildDate>Sun, 02 May 2010 20:58:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using Python to Format Json</title>
		<link>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/</link>
		<comments>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 08:04:47 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[Api]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=159</guid>
		<description><![CDATA[I have been working quite a bit with Json. Json disregards whitespace by implementation this makes the standard format of Json being a single very long line of not so readable text. Simple example. {"query":"some text","results":[{"title":"some result","id":"213"}]} I had some plan to write some simple python script to format it nicely. I have used the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working quite a bit with <a href="http://json.org">Json</a>. <a href="http://json.org">Json</a> disregards whitespace by implementation this makes the standard format of <a href="http://json.org">Json</a> being a single very long line of not so readable text.<br />
Simple example.<br />
<code>{"query":"some text","results":[{"title":"some result","id":"213"}]}</code><br />
I had some plan to write some simple python script to format it nicely. I have used the <a href="http://blog.smartcube.co.za/2009/07/02/re-dumping-currently-loaded-firefox-urls/">json module before</a>, I wasn&#8217;t aware it had a format function  as part of<a href="http://docs.python.org/library/json.html ">json.tool</a>.</p>
<p><a href="http://curl.haxx.se/">curl</a> + <a href="http://json.org">Json</a> + <a href="http://python.org">Python</a><br />
<code>curl  http://domain.com/api.json 2> /dev/null | python -mjson.tool</code></p>
<p>I found that with our redirection the error output to /dev/null i was getting.</p>
<blockquote><p> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br />
                                 Dload  Upload   Total   Spent    Left  Speed<br />
  0    67    0    67    0     0     76      0 &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211;     0</p></blockquote>
<p>Formated Json</p>
<blockquote><pre>
{
    "query": "some text",
    "results": [
        {
            "id": "213",
            "title": "some result"
        }
    ]
}</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
