<?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>Pointless Corp &#187; Mark Cornick</title>
	<atom:link href="http://www.pointlesscorp.com/author/mcornick/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pointlesscorp.com</link>
	<description>Neither pointless nor a corporation.</description>
	<lastBuildDate>Fri, 25 Feb 2011 16:28:25 +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>FeedStitch and JSON</title>
		<link>http://www.pointlesscorp.com/feedstitch-and-json/</link>
		<comments>http://www.pointlesscorp.com/feedstitch-and-json/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 13:50:27 +0000</pubDate>
		<dc:creator>Mark Cornick</dc:creator>
				<category><![CDATA[FeedStitch]]></category>

		<guid isPermaLink="false">http://www.pointlesscorp.com/?p=73</guid>
		<description><![CDATA[Recently, we introduced FeedStitch, our quick and easy feed aggregator. As we mentioned previously, one of the objectives for FeedStitch was to make it easy for computers as well as humans to use. Towards that end, we chose JSON as one of the output options. In this post, I’ll show you how you can use [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pointlesscorp.com/introducing-feedstitch/">Recently</a>, we introduced <a href="http://feedstitch.com/">FeedStitch</a>, our quick and easy feed aggregator. As we mentioned previously, one of the objectives for FeedStitch was to make it easy for computers as well as humans to use. Towards that end, we chose <a href="http://www.json.org/">JSON</a> as one of the output options. In this post, I’ll show you how you can use FeedStitch’s JSON output to integrate a group into a web page.</p>
<p><span id="more-73"></span><br />
All of the source code for this example is <a href="http://gist.github.com/71678">available from gist.github.com</a>. Go ahead and open up that gist link to follow along.</p>
<p>In our HTML page, we include two JavaScript files. The first is a FeedStitch group, in JSON format, as evidenced by the <code>.json</code> extension. Notice that we’re adding a variable, <code>feedstitch</code>, as a parameter. When you use do this, FeedStitch modifies its output to assign the JSON object to the variable we name. You can also specify the name of a JavaScript function using the <code>callback</code> parameter; if you do this, FeedStitch modifies its output to call that callback function with the JSON text as an argument. This technique, sometimes called JSONP, allows you to simply include the FeedStitch script and have a JavaScript object automatically prepared with the contents of the group.</p>
<p>(This would be a good place to mention that this technique allows the remote site (in this case, FeedStitch) to theoretically inject any content into your web page. At FeedStitch, we are only interested in good, not evil, so we will never intentionally use this functionality to do evil things. But you should still proceed thus informed.)</p>
<p>The second JavaScript file does all the work of inserting the group content into the page. Using the standard DOM methods, we create a list and populate it with entries from our group. This is only one way to do it, and it’s frankly the hard way; the easy way would be to use <a href="http://jquery.com/">jQuery</a> and its JSON parser. Keith Muth covers using jQuery on the <a href="http://www.viget.com/inspire/feedstitch-and-json-using-jquery/">Viget Inspire</a> blog, if you’re interested in seeing a different approach.</p>
<p>Since we didn’t write any CSS, this looks plain, but our group is there on the page:</p>
<p><img src="http://www.pointlesscorp.com/wp-content/uploads/2009/02/json.png" alt="JSON" width="573" height="284" /></p>
<p>This demonstration is pretty basic, but given that parsing the JSON produces a full-fledged JavaScript object, there are all kinds of possibilities, like widgets, desktop clients, or anything else. If JavaScript’s not your language of choice, JSON parsers are <a href="http://www.json.org/">available</a> for nearly every modern programming language. Give it a try and see what you can do with FeedStitch and JSON!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pointlesscorp.com/feedstitch-and-json/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

