<?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>Melbourne Web Developer, Website Design &#38; Development &#187; JSON</title>
	<atom:link href="http://blog.koumei.net/tag/json/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.koumei.net</link>
	<description>= fn(n){n xor 0xFFFF004B eq 0x0 ? n : fn(n - 0x1)}</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:26:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Simple Rss2Json Service Released!</title>
		<link>http://blog.koumei.net/2009/03/20/a-simple-rss2json-service-released/</link>
		<comments>http://blog.koumei.net/2009/03/20/a-simple-rss2json-service-released/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 14:33:43 +0000</pubDate>
		<dc:creator>Koumei</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tech.]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.koumei.net/?p=264</guid>
		<description><![CDATA[Now I simply add a Rss2Json service on my blog, it just return the very first post from the target website as JSON and, of course, the target should be RSS format. The reason why I create this interface is because I would like to utilize cool AJAX to obtain the content from my friend&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Now I simply add a Rss2Json service on my blog, it just return the very first post from the target website as JSON and, of course, the target should be RSS format. The reason why I create this interface is because I would like to utilize cool AJAX to obtain the content from my friend&#8217;s blog, yet the browser secure prevent me crossing the boundary to other domain. Could it be working using iFrame? Negative. The only approach to cross the border is using JSON.</p>
<p>The definition of my interface is:</p>
<p><strong>Name</strong>: Rss2JSon<br />
<strong>Interface</strong>: http://www.koumei.net/rss2json/<br />
<strong>Method</strong>: GET<br />
<strong>Parameter 1</strong>:  rss  &#8211; The URL of the rss content<br />
<strong>Parameter 2</strong>: cb &#8212; The javascript callback function<br />
<strong>Return</strong>: application/x-javascript<br />
<strong>Example</strong>: http://www.koumei.net/rss2json/?rss=http://www.blogjava.net/max/rss&amp;cb=&lt;callback&gt;  (A blog of my friend)</p>
<p>The callback function is very <strong><span style="font-family: mceinline;"><span style="text-decoration: underline;">significant</span></span></strong>. Don&#8217;t forget to define a callback JS function on your script. The definition of the callback function should be similar as below ( parameter rss is an object, containing &#8220;title&#8221;, &#8220;link&#8221; and &#8220;description&#8221; and so forth&lt;please go through RSS schema on item tag&gt;.)</p>
<p><em>&lt;script type=&#8221;text/javascript&#8221;&gt; </em></p>
<p><em>function myCallback(rss){<br />
    var title = rss["title"];   // or rss.title<br />
    var link = rss["link"];  // or rss.link<br />
    var desc = rss["description"];  // or rss.description.<br />
}</em></p>
<p><em>&lt;/script&gt;</em></p>
<p>Now, you can embed the script to wherever you need.<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://www.koumei.net/rss2json/?rss=http://www.blogjava.net/max/rss&amp;cb=myCallback&#8221;&gt;&lt;/script&gt; </p>
<p>Enjoy scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.koumei.net/2009/03/20/a-simple-rss2json-service-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
