<?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>Phil Leggetter - Software Consultant &#187; real-time</title>
	<atom:link href="http://www.leggetter.co.uk/tag/real-time/feed" rel="self" type="application/rss+xml" />
	<link>http://www.leggetter.co.uk</link>
	<description>Real-time web and social media software consultant</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Thoughts on the TechCrunch ChristmasCrunch (#xmascrunch)</title>
		<link>http://www.leggetter.co.uk/2009/12/22/thoughts-on-the-techcrunch-christmascrunch-xmascrunch.html</link>
		<comments>http://www.leggetter.co.uk/2009/12/22/thoughts-on-the-techcrunch-christmascrunch-xmascrunch.html#comments</comments>
		<pubDate>Tue, 22 Dec 2009 12:59:54 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[xmascrunch]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=619</guid>
		<description><![CDATA[Last week I attended the TechCrunch ChristmasCrunch whi [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/12/01/the-christmascrunch-nearly-real-time-web-event.html' rel='bookmark' title='Permanent Link: The ChristmasCrunch nearly real-time web event'>The ChristmasCrunch nearly real-time web event</a></li>
<li><a href='http://www.leggetter.co.uk/2009/07/01/microsoft-bing-com-round-table-thoughts.html' rel='bookmark' title='Permanent Link: Microsoft Bing.com round table thoughts'>Microsoft Bing.com round table thoughts</a></li>
<li><a href='http://www.leggetter.co.uk/2010/03/10/when-does-now-matter.html' rel='bookmark' title='Permanent Link: When does NOW matter?'>When does NOW matter?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the <a  href="http://eu.techcrunch.com/2009/11/06/techcrunch-europe-christmascrunch-its-a-realtime-holiday/">TechCrunch ChristmasCrunch</a> which came with the tagline “It’s a realtime holiday”. It’s great to see so many companies embracing the real-time web and building their businesses around it. Some companies that you would still class as start-ups such as <a  href="http://tweetdeck.com/">TweetDeck</a>, <a  href="http://seesmic.com/">Seesmic</a> and <a  href="http://tweetmeme.com/">tweetmeme</a> are now relatively established and there were a dozen or more startup pitches with the majority of these new companies focusing on the real-time web.</p>
<p>There’s so much data being generated by social networks that it wasn’t surprising that a lot of the focus was around analysing the data. The key words from the event in relation to the data were <strong>relevance</strong>, <strong>sentiment</strong>, <strong>curation</strong>, <strong>authority</strong> and <strong>location</strong>. All of these terms play off each other. <strong>Relevance</strong> can be determined by authority and location. <strong>Sentiment</strong>, <strong>relevance</strong> and <strong>authority</strong> can be determined by a curation process. Some solutions to curation pitched at the event were based on language and text analysis, whilst others suggested crowdsourcing and using manual intervention as a means of determining the quality of data.<br />
<span id="more-619"></span><br />
Of all the presentations, panels and startup pitches there was not all that much time spent talking about underlying technology used by any of the companies. <a  href="http://jameswhittaker.co.uk/">James Whittaker</a> of TweetDeck reiterated <a  href="http://www.ustream.tv/recorded/2834854">Iain Dodsworths words from Le Web</a> in saying TweetDeck would stay with the Adobe Air platform. He also mentioned that they were looking forward to the version 2.0 release of Air – I wish I’d asked why. <a  href="http://twitter.com/Marco">Marco Kaiser</a> of Seesmic, in my eyes TweetDeck’s main rival, talked about moving to the Windows platform to increase application performance and provide a plugin development framework. Other than that the only other mention of technology that I can remember were a couple of mentions of PUSH by David Maher Roberts of <a  href="http://www.thefilter.com/">The Filter</a>, who said none of their clients were using PUSH at the moment but there were requests in place and a POC ongoing, and <a  href="http://twitter.com/thetimmorgan">Tim Morgan</a> of <a  href="http://mintdigital.com/">Mint Digital</a> who have recently released <a  href="http://football3s.com/">Football3’s</a> which clearly relies on true real-time in order to be interactive.</p>
<p>It was a very interesting event and I’m really pleased that I attended but I would really have liked to have gained some insight into the technologies that companies are using and would have liked to see people talking about and moving to “real-time” in the true sense of the term rather than it being used as a marketing term.</p>
<p>You can view <a  href="http://eu.techcrunch.com/2009/12/16/xmascrunch-speakers-and-pitches-in-video/">videos of most of the presentations on TechCrunch</a>. Look out for one lady finding it particularly funny when I went to ask Marco of Seesmic a question and introduced myself:</p>
<blockquote><p>
Hi, I&#8217;m Phil Leggetter and I&#8217;m a Real-Time Web Software Consultant&#8230; I just made that up!
</p></blockquote>
<p>This was a joke, I really am a &#8220;Real-Time Web Software Consultant&#8221;, but I thought it might be quite funny, but not THAT funny. You can see this at just after 7:00 on this video:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="386" id="utv338525" name="utv_n_530726"><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=3127064" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/video/3127064" /><embed flashvars="loc=%2F&amp;autoplay=false&amp;vid=3127064" width="480" height="386" allowfullscreen="true" allowscriptaccess="always" id="utv338525" name="utv_n_530726" src="http://www.ustream.tv/flash/video/3127064" type="application/x-shockwave-flash" /></object></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;title=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F22%2Fthoughts-on-the-techcrunch-christmascrunch-xmascrunch.html&amp;t=Thoughts+on+the+TechCrunch+ChristmasCrunch+%28%23xmascrunch%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/12/01/the-christmascrunch-nearly-real-time-web-event.html' rel='bookmark' title='Permanent Link: The ChristmasCrunch nearly real-time web event'>The ChristmasCrunch nearly real-time web event</a></li>
<li><a href='http://www.leggetter.co.uk/2009/07/01/microsoft-bing-com-round-table-thoughts.html' rel='bookmark' title='Permanent Link: Microsoft Bing.com round table thoughts'>Microsoft Bing.com round table thoughts</a></li>
<li><a href='http://www.leggetter.co.uk/2010/03/10/when-does-now-matter.html' rel='bookmark' title='Permanent Link: When does NOW matter?'>When does NOW matter?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/12/22/thoughts-on-the-techcrunch-christmascrunch-xmascrunch.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How does Google Real-Time Search work?</title>
		<link>http://www.leggetter.co.uk/2009/12/12/how-does-google-real-time-search-work.html</link>
		<comments>http://www.leggetter.co.uk/2009/12/12/how-does-google-real-time-search-work.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 14:18:20 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Le Web]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time web]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=600</guid>
		<description><![CDATA[On or around the 12th of December 2009 Google released  [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2010/08/27/google-realtime-search-isnt-real-time.html' rel='bookmark' title='Permanent Link: Google realtime search isn&#8217;t real-time'>Google realtime search isn&#8217;t real-time</a></li>
<li><a href='http://www.leggetter.co.uk/2010/05/18/add-real-time-news-to-your-site-with-google-add-any-real-time-data-to-your-site-with-kwwika.html' rel='bookmark' title='Permanent Link: Add real-time news to your site with Google. Add any real-time data to your site with Kwwika'>Add real-time news to your site with Google. Add any real-time data to your site with Kwwika</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Permanent Link: Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>On or around the 12th of December 2009 Google released a feature they are calling &#8220;real-time search&#8221;.</p>
<blockquote cite="http://googleblog.blogspot.com/2009/12/relevance-meets-real-time-web.html"><p>Our real-time search enables you to discover breaking news the moment it&#8217;s happening, even if it&#8217;s not the popular news of the day, and even if you didn&#8217;t know about it beforehand.</p></blockquote>
<p>Although I&#8217;d still argue that we&#8217;re not seeing the real-time web with this solution I thought I&#8217;d go in to a bit of detail about how Google are achieving this HTTP polling solution.</p>
<h2>Summary</h2>
<ul>
<li>Google are consuming and indexing real-time data from multiple social networks</li>
<li>It&#8217;s not real-time HTTP PUSH yet, it&#8217;s HTTP PULL using a polling interval</li>
<li>The polling interval seems to vary but this needs to be confirmed.</li>
<li>The polling result returns an encoded JSON response containing the next request to be made and the HTML of any new results. These results are injected into the &#8220;Latest results&#8221; section of the page</li>
<li>The HTML returned is quite verbose and could be refined</li>
<li>87% from a sample of 30 polled requests returned no new results meaning the request was a waste of resources</li>
</ul>
<p><span id="more-600"></span></p>
<h2>Data Sources</h2>
<p>Google now has an agreement in place with Twitter, Facebook, MySpace, FriendFeed, Identi.ca and Jaiku to consume and index their real-time data and make the results available in a &#8220;Latest Results&#8221; section of the Google search results. A number of social networks have APIs and some of these APIs have a real-time streaming feed and it&#8217;s likely that Google is simply connecting to this. For example, MySpace have <a  href="http://developer.myspace.com/Community/blogs/devteam/archive/2009/12/08/opening-the-flood-gates-and-unleashing-the-data.aspx">released a Real-Time Stream API</a> and Twitter has a Firehose feed, both of which Google will be using in their real-time search results. The Twitter Firehose feed is <a  href="http://apiwiki.twitter.com/FAQ#CanIhavetheFirehose">&#8220;not generally available&#8221;</a> at the moment but Ryan Sarver, who is Director of Platform at Twitter, <a  href="http://www.ustream.tv/recorded/2748326">announced at Le Web</a> that the Firehose stream would become generally available in the future.<br />
<br />
<object id="utv142723" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="386" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="utv_n_321380" /><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=2748326" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/video/2748326" /><embed id="utv142723" type="application/x-shockwave-flash" width="480" height="386" src="http://www.ustream.tv/flash/video/2748326" allowscriptaccess="always" allowfullscreen="true" flashvars="loc=%2F&amp;autoplay=false&amp;vid=2748326" name="utv_n_321380"></embed></object><br />
</p>
<h2>How Google put the real-time data into their search results?</h2>
<p>Since Google now have access to the data as soon as it is generated by the social network the next thing they need to do is get that into your search results. As soon as you make your search Google can put information that has just become available straight into the page. However, how do they get information that becomes available after your search results page has already loaded? Simple. They poll for new results regular intervals (as I mentioned in my <a  href="http://www.leggetter.co.uk/2009/12/09/how-real-time-does-real-time-have-to-be.html">How real-time does real-time have to be?</a> blog post). So far I&#8217;ve seen a 20 second polling interval but recently, with a <a  href="http://www.google.co.uk/search?q=%23leweb">search for #leweb</a>, I&#8217;ve seen a 30 second polling interval. It&#8217;s possible that they may have an idea how likely it is that your search subject will have new information available and change this polling interval accordingly.</p>
<p>These polling search requests look like this:</p>
<pre>

<a  href="http://www.google.co.uk/realtimejs?q=%23leweb" rel="nofollow">http://www.google.co.uk/realtimejs?q=%23leweb</a>

&#038;hl=en
&#038;polltype=mb
&#038;since=1260622409000000
&#038;sessionstart=1260623982000000
&#038;ei=bpgjS5zOG8j54Ab5kMzpCQ
&#038;usg=05e5
</pre>
<p>And the responses:</p>
<pre class="brush: jscript;">
mbrt0.insert('{\x22nextRequest\x22:\x22/realtimejs?q\\x3d%23leweb\\x26hl\\x3den\\x26output\\x3dsearch\\x26since\\x3d1260623734161591\\x26sessionstart\\x3d1260623385000000\\x26ei\\x3dbpgjS5zOG8j54Ab5kMzpCQ\\x26usg\\x3d3760\x22,\x22results\x22:[{\x22date\x22:\x221260623734161590\x22,\x22html\x22:\x22\\x3cli class\\x3d\\x22g s\\x22 style\\x3d\\x22line-height:16px;margin:0 0 8px;overflow:hidden\\x22\\x3e\\x3ctable class\\x3d\\x22ts\\x22\\x3e\\x3ctr\\x3e\\x3ctd colspan\\x3d3 class\\x3drt2 style\\x3d\\x22overflow:none\\x22\\x3e\\x3cdiv class\\x3drt1 style\\x3d\\x22background-position:-4px 0;width:6px;height:4px;float:right\\x22\\x3e\\x3c/div\\x3e\\x3cdiv class\\x3drt1 style\\x3d\\x22width:4px;height:4px\\x22\\x3e\\x3c/div\\x3e\\x3ctr\\x3e\\x3ctd class\\x3drt1 style\\x3d\\x22background-position:-10px 0;background-repeat:repeat\\x22\\x3e\\x3cdiv style\\x3d\\x22width:2px\\x22\\x3e\\x3c/div\\x3e\\x3ctd style\\x3d\\x22padding:0 5px 1px;width:100%\\x22\\x3eFinally back at home after a long week in Paris. Great time at \\x3ca href\\x3d\\x22/search?q\\x3d%23LeWeb+site%3Atwitter.com\\x26amp;tbs\\x3dmbl:1\\x26amp;tbo\\x3d1\\x26amp;hl\\x3den\\x26amp;output\\x3dsearch\\x26amp;ei\\x3dcZgjS8PMNZbSjAfnl_nYBw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmicroblog_result\\x26amp;resnum\\x3d1\\x26amp;ct\\x3dresult\\x26amp;cd\\x3d1\\x26amp;ved\\x3d0CAMQoAQoADAA\\x22\\x3e#\\x3cem\\x3eLeWeb\\x3c/em\\x3e\\x3c/a\\x3e. Reconnected with lots of old friends etc,\\x3ctd class\\x3drt1 style\\x3d\\x22background-position:-14px 0;background-repeat:repeat\\x22\\x3e\\x3cdiv style\\x3d\\x22width:3px\\x22\\x3e\\x3c/div\\x3e\\x3ctr\\x3e\\x3ctd colspan\\x3d3 class\\x3drt2 style\\x3d\\x22background-position:-4px\\x22\\x3e\\x3cdiv class\\x3drt1 style\\x3d\\x22background-position:-4px -4px;width:6px;height:6px;float:right\\x22\\x3e\\x3c/div\\x3e\\x3cdiv class\\x3drt1 style\\x3d\\x22background-position:0 -4px;width:4px;height:6px\\x22\\x3e\\x3c/div\\x3e\\x3c/table\\x3e\\x3cdiv class\\x3drt1 style\\x3d\\x22background-position:-17px 0;margin-top:-3px;margin-left:5px;padding:4px 0 0 23px\\x22\\x3e\\x3cspan class\\x3dgl\\x3e\\x3ca href\\x3d\\x22http://twitter.com/bdesarnauts\\x22 class\\x3dl onmousedown\\x3d\\x22return clk(this.href,\\x27microblog_result\\x27,\\x27\\x27,\\x27result\\x27,\\x271\\x27,\\x27\\x27,\\x270CAIQoAQwAA\\x27)\\x22\\x3ebdesarnauts\\x3c/a\\x3e\\x3c/span\\x3e - \\x3cspan class\\x3da\\x3etwitter.com\\x3c/span\\x3e - \\x3ca href\\x3d\\x22/url?q\\x3dhttp://twitter.com/bdesarnauts/status/6598672912\\x26amp;ei\\x3dcZgjS8PMNZbSjAfnl_nYBw\\x26amp;sa\\x3dX\\x26amp;oi\\x3dmicroblog_result\\x26amp;resnum\\x3d1\\x26amp;ct\\x3dresult\\x26amp;cd\\x3d2\\x26amp;ved\\x3d0CAQQoAQoADAA\\x26amp;usg\\x3dAFQjCNEyjEaOrJexPm6wUgqqVEDg24BOFQ\\x22 style\\x3d\\x22text-decoration:none\\x22\\x3e\\x3cspan class\\x3d\\x22f rtdm\\x22\\x3e4 minutes ago\\x3c/span\\x3e\\x3c/a\\x3e\\x3c/div\\x3e\x22}]}');
</pre>
<p>The response is an encoded JSON response and contains two things:</p>
<ul>
<li><strong>nextRequest</strong>: The next polling search request to make</li>
<li><strong>results</strong>: An Array of Encoded HTML for any results that have been found for the current polling request.</li>
</ul>
<p>In the example response above we get a next request of:</p>
<pre class="brush: plain;">
/realtimejs?
q\\x3d%23leweb\\x26hl\\x3den\\x26output\\x3dsearch\\x26since\\x3d1260623734161591\\x26sessionstart\\x3d1260623385000000\\x26ei\\x3dbpgjS5zOG8j54Ab5kMzpCQ\\x26usg\\x3d3760
</pre>
<p>Which translates to the following URL:</p>
<pre>

<a  href="http://www.google.co.uk/realtimejs?q=%23leweb&#038;hl=en&#038;output=search&#038;since=1260623734161591&#038;sessionstart=1260623385000000&#038;ei=bpgjS5zOG8j54Ab5kMzpCQ&#038;usg=3760" rel="nofollow">http://www.google.co.uk/realtimejs?q=%23leweb&#038;hl=en&#038;output=search&#038;since=1260623734161591&#038;sessionstart=1260623385000000&#038;ei=bpgjS5zOG8j54Ab5kMzpCQ&#038;usg=3760</a>
</pre>
<p>From looking at the parameters it would appear that the <strong>since</strong> parameter would be very useful and would allow you to retrieve historical updates.</p>
<p>Each encoded HTML result in the results array will be decoded on the client using JavaScript and injected into the &#8220;Latest Results&#8221; section within the search result listings. It&#8217;s quite surprising that they return quite so much encoded HTML content and not just the information and then generate the HTML on the client. I suppose this is a new feature and it will be refined over time.</p>
<p>One point worth mentioning is that because Google are using a polling technique they are performing a lot of HTTP PULL requests to the server that return no results. This is a wasted request. From a sample size of 30 polled requests only 4 requests actually returned new results. This means that 87% of requests are a complete waste of resources.</p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;title=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+does+Google+Real-Time+Search+work%3F+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F12%2F12%2Fhow-does-google-real-time-search-work.html&amp;t=How+does+Google+Real-Time+Search+work%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2010/08/27/google-realtime-search-isnt-real-time.html' rel='bookmark' title='Permanent Link: Google realtime search isn&#8217;t real-time'>Google realtime search isn&#8217;t real-time</a></li>
<li><a href='http://www.leggetter.co.uk/2010/05/18/add-real-time-news-to-your-site-with-google-add-any-real-time-data-to-your-site-with-kwwika.html' rel='bookmark' title='Permanent Link: Add real-time news to your site with Google. Add any real-time data to your site with Kwwika'>Add real-time news to your site with Google. Add any real-time data to your site with Kwwika</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Permanent Link: Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/12/12/how-does-google-real-time-search-work.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Real Time Rich Internet Application (RTRIA) Example</title>
		<link>http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html</link>
		<comments>http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html#comments</comments>
		<pubDate>Tue, 03 Nov 2009 20:12:45 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[RTRIA]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=423</guid>
		<description><![CDATA[I've just had an article published in the latest UK MSD [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Permanent Link: Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
<li><a href='http://www.leggetter.co.uk/2009/11/07/which-rich-internet-application-technology-will-dominate.html' rel='bookmark' title='Permanent Link: Which Rich Internet Application Technology will dominate?'>Which Rich Internet Application Technology will dominate?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html' rel='bookmark' title='Permanent Link: Using Fiddler to trick Silverlight into allowing a crossdomain Web Request'>Using Fiddler to trick Silverlight into allowing a crossdomain Web Request</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just had an article published in the latest <a  href="http://msdn.microsoft.com/en-gb/aa570311.aspx">UK MSDN Flash newsletter</a> on <strong>How to consume real-time data in a Silverlight RIA</strong>. As part of writing up the article I developed a sample <a  title="Real-Time Rich Internet Application" href="http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html">Real-Time Rich Internet Application (RTRIA)</a> that consumes real-time data from the <a  href="http://apiwiki.twitter.com/Streaming-API-Documentation">Twitter real-time data feed</a>. I also put together my first ever <a  href="http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html#screencast">screencast</a>. So, you can start by <a  href="http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html#code">getting hold of the code</a> or <a  href="http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html#screencast">watching the screencast</a>.</p>
<p><a name="code"></a></p>
<h2>The Code</h2>
<p>First, and this is <strong>Important</strong>:</p>
<div class="important">To get the sample application to stream real-time data from the Twitter real-time feed you will need to <a href="http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html">use Fiddler to trick Silverlight into allowing a crossdomain Web Request</a>.</div>
<p>Now that you are aware of that, you will also need the Silverlight development environment. You can get everything you need via the <a  href="http://silverlight.net/getstarted/">Silverlight Getting Started page</a>.</p>
<p>You&#8217;ve now got everything you need to run the <em>RTRIA</em> example. To run the sample application you should set the <em>MSDNFlashRTRIAExample.Web</em> project as the startup project and the <em>MSDNFlashRTRIAExampleTestPage.html</em> page as the startup page.</p>
<div id="attachment_488" class="wp-caption alignnone" style="width: 345px"><img class="size-full wp-image-488" title="Setting up the solution to run the application" src="http://www.leggetter.co.uk/wp-content/uploads/2009/11/SetupForRunning.png" alt="Setting up the solution to run the application" width="335" height="264" /><p class="wp-caption-text">Setting up the solution to run the application</p></div>
<p>If you&#8217;d like to find out a bit more about the code then read on. If you&#8217;d rather jump straight into the code you can download it from the <a  href="http://code.google.com/p/tweetstreamer/">TweetStreamer Google Code project</a>.<br />
<span id="more-423"></span></p>
<h3>The streaming connection</h3>
<p>The following extracts of code may be slightly modified but that has been done to be able to explain what the code does in general a bit better.</p>
<p>The following extract is used to establish a connection to the Twitter real-time data stream using a <a  href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.95).aspx">HttpWebRequest</a>. The important thing to note is the use of <code>request.AllowReadStreamBuffering = false;</code> which is required since we are requesting a streaming feed. Without setting the <a  href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.allowreadstreambuffering(VS.95).aspx">AllowReadStreamBuffering</a> property to <code>false</code> the <code>ConnectionResponseCallback</code> callback will not be invoked because the response will be continuously buffering.</p>
<p>Since the Twitter real-time data stream requires authentication, and we can&#8217;t set <a  href="http://msdn.microsoft.com/en-us/library/system.net.webrequest.credentials(VS.95).aspx">Credentials</a> on the <code>HttpWebRequest</code> in Silverlight, the browser will prompt the user for a username and password.</p>
<pre class="brush: csharp;">
private const string SPRITZER_URL = &quot;http://stream.twitter.com/1/statuses/sample.json&quot;;

/// &lt;summary&gt;
/// Starts the connection to the Twitter real-time data stream.
/// &lt;/summary&gt;
public void Connect()
{
    this.InternalConnectionStatus = ConnectionStatus.Connecting;

    try
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(SPRITZER_URL));
        request.AllowReadStreamBuffering = false;
        request.BeginGetResponse(ConnectionResponseCallback, request);
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex);
        this.InternalConnectionStatus = ConnectionStatus.Disconnected;
    }
}
</pre>
<p>Within the callback method we ensure that we are connected and then call the <code>ReadResponseStream</code> method which will not return until we call <code>Disconnect()</code>.</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
/// Called when the initial connection has been established.
/// &lt;/summary&gt;
private void ConnectionResponseCallback(IAsyncResult asynchronousResult)
{
    try
    {
        HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
        using (HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult))
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                this.InternalConnectionStatus = ConnectionStatus.Connected;

                this.ReadResponseStream(request, response);

                if (this.InternalConnectionStatus != ConnectionStatus.Disconnecting)
                {
                    // unexpected status
                    Debug.WriteLine(&quot;unexpected connection status: &quot; + this.InternalConnectionStatus);
                }
            }
            else
            {
                Debug.WriteLine(&quot;unexpected status code: &quot; + response.StatusCode);
            }
        }

        this.InternalConnectionStatus = ConnectionStatus.Disconnected;
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex);
    }
}
</pre>
<p>In the <code>ReadResponseStream</code> method we continually read the stream until we are interrupted by the user setting the connection status to a value other than <code>ConnectionStatus.Connected</code>, by calling the <code>Disconnect()</code> method, or an exception is thrown whilst reading from the <code>stream</code>. For each read from the stream we parse the data to get the tweets from the real-time data feed in <a  href="http://json.org/">JSON</a> format.</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
/// Reads the information received from the Twitter real-time data stream.
/// &lt;/summary&gt;
private void ReadResponseStream(HttpWebRequest request, HttpWebResponse response)
{
    byte[] buffer = new byte[65536];
    using (Stream stream = response.GetResponseStream())
    {
        while (this.InternalConnectionStatus == ConnectionStatus.Connected)
        {
            int read = stream.Read(buffer, 0, buffer.Length);
            UTF8Encoding encoding = new UTF8Encoding();
            string data = encoding.GetString(buffer, 0, read);
            ParseResponseChunk(data);
        }

        // need to call request.Abort or the the thread will block at the end of
        // the using block.
        request.Abort();
    }
}
</pre>
<p>The <code>ParseResponseChunk</code> checks the data it&#8217;s passed and ensures that the data contains at least one full status message (tweet). I&#8217;ll not go into the details of that here since it&#8217;s just a matter of string parsing.</p>
<p><small>I chose to use the JSON format simply because the content passed over the wire is smaller than the XML feed. This should mean that the application has to do less work to read all the data. What we really should also do is benchmark the deserialisation of JSON against the deserialisation of XML to see which performs best within a Silverlight application.<br />
</small></p>
<h3>Deserialising the JSON</h3>
<p>The following JavaScript JSON snipped shows an example of a single Tweet that we get back from the Twitter real-time data feed.</p>
<pre class="brush: jscript;">
{
    &quot;in_reply_to_status_id&quot;:9999999,
    &quot;in_reply_to_user_id&quot;:00000000,
    &quot;favorited&quot;:false,
    &quot;in_reply_to_screen_name&quot;:&quot;leggetter&quot;,
    &quot;text&quot;:&quot;@leggetter Wow! A Real-Time Rich Internet Application (RTRIA)&quot;,
    &quot;id&quot;:2820354600,
    &quot;created_at&quot;:&quot;Fri Nov 4 09:39:33 +0000 2009&quot;,
    &quot;truncated&quot;:false,
    &quot;source&quot;:&quot;&lt;a href=\&quot;http:\/\/tweetdeck.com\/\&quot;&gt;TweetDeck&lt;\/a&gt;&quot;
}
</pre>
<p>The JSON can be deserialised as an instance of a C# class using the <a  href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute(VS.95).aspx">DataContract</a> attribute on the class and the <a  href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute(VS.95).aspx">DataMember</a> attributes on properties.</p>
<pre class="brush: csharp;">
using System;
using System.Runtime.Serialization.Json;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace TweetStreamer
{
    [DataContract]
    public class StatusMessage : IStatusMessage, INotifyPropertyChanged
    {
        [DataMember(Name = &quot;text&quot;)]
        public string Text {get;set}
    }
}
</pre>
<p>A single Tweet, or in TweetStreamer a <code>StatusMessage</code>, can be deserialised using an instance of the <a  href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer(VS.95).aspx">DataContractJsonSerializer</a>.</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
/// Creates a single message from json string.
/// &lt;/summary&gt;
/// &lt;param name=&quot;messageData&quot;&gt;The message data.&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
private static IStatusMessage CreateMessageFromJsonString(string messageData)
{
    Debug.WriteLine(String.Format(&quot;Creating StatusMessage for: {0}&quot;, messageData));

    IStatusMessage message = null;

    using (MemoryStream stream = new MemoryStream(UTF8Encoding.UTF8.GetBytes(messageData)))
    {
        DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(StatusMessage));
        message = ser.ReadObject(stream) as StatusMessage;
    }

    if (string.IsNullOrEmpty(message.Id))
    {
        message = null;
        Debug.WriteLine(&quot;message had no ID. Assuming to be a delete message so nulling message object&quot;);
    }

    return message;
}
</pre>
<h3>Binding the data to the grid</h3>
<p>To bind the data to a DataGrid the grid needs to be defined in XAML. In addition we can specify the properties on the <code>StatusMessage</code> that we want to bind to columns. In the XAML below we are binding the <code>CreatedAtString</code> property to a Time column, a <code>User.ScreenName</code> to a User column, and a <code>Text</code> property to a Message column. Notice the cool binding of <code>User.ScreenName</code>. The <code>StatusMessage.User</code> property returns an instance of another class and we are actually binding to a property on the returned class.</p>
<pre class="brush: xml;">
&lt;data:DataGrid Grid.Row=&quot;0&quot; x:Name=&quot;Tweets&quot; AutoGenerateColumns=&quot;False&quot;&gt;
    &lt;data:DataGrid.Columns&gt;
        &lt;data:DataGridTextColumn Header=&quot;Time&quot;
            Binding=&quot;{Binding CreatedAtString}&quot; /&gt;
        &lt;data:DataGridTextColumn Header=&quot;User&quot;
            Binding=&quot;{Binding User.ScreenName}&quot; /&gt;
        &lt;data:DataGridTextColumn Header=&quot;Message&quot;
            Binding=&quot;{Binding Text}&quot; /&gt;
    &lt;/data:DataGrid.Columns&gt;
&lt;/data:DataGrid&gt;
</pre>
<p>Next, the code to set up the binding and registering for <code>StatusMessage</code> updates using the <code> StatusMessageReceived</code> event. As you many have noticed, the <code>StatusMessage</code> object implements the <a  href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(VS.95).aspx">INotifyPropertyChanged</a> interface. This was used so that we could add each <code>StatusMessage</code> to an <a  href="http://msdn.microsoft.com/en-us/library/ms668604(VS.95).aspx">ObservableCollection&lt;T&gt;</a> and then bind it to a <a  href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid(VS.95).aspx">DataGrid</a> to display the Tweets in real-time.</p>
<pre class="brush: csharp;">
Connection _twitterConnection;
ObservableCollection&lt;IStatusMessage&gt; _messages = new ObservableCollection&lt;IStatusMessage&gt;();
public MainPage()
{
    InitializeComponent();

    Tweets.ItemsSource = _messages;

    _twitterConnection = new Connection();
    _twitterConnection.StatusMessageReceived += new Connection.OnStatusMessageReceivedEventHandler
        (twitterConnection_StatusMessageReceived);
    _twitterConnection.Connect();
}
</pre>
<p>Finally, whenever we get a <code>StatusMessageReceived</code> callback we need to add the new <code>StatusMessage</code> to the <code>ObservableCollection<T></code> collection. <em>This has to be done on the UI thread and via the <code>Tweets.ItemsSource</code> property or the UI will not update.</em></p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
/// Status message received event handler.
/// &lt;/summary&gt;
/// &lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;
/// &lt;param name=&quot;args&quot;&gt;&lt;/param&gt;
void twitterConnection_StatusMessageReceived(object sender, IStatusMessageReceivedEventArgs args)
{
    Dispatcher.BeginInvoke(() =&gt;
        AddMessage(args.Message)
    );
}

/// &lt;summary&gt;
/// Adds a message to the observable message list which updates the UI.
/// &lt;/summary&gt;
/// &lt;param name=&quot;message&quot;&gt;&lt;/param&gt;
void AddMessage(IStatusMessage message)
{
    ObservableCollection&lt;IStatusMessage&gt; messageList = ((ObservableCollection&lt;IStatusMessage&gt;)Tweets.ItemsSource);
    messageList.Insert(0, message);
}
</pre>
<p>Hopefully this will have helped you understand how the Twitter real-time data stream is consumed and an example of how you can use it within a <strong>Real-Time Rich Internet Application</strong>. Now, why now <a  href="http://code.google.com/p/tweetstreamer/">download the TweetStreamer library and example application</a> and have a play.</p>
<div class="information"><strong>Limitations</strong>: Although I&#8217;ve seen the sample application perform reasonably well I&#8217;ve also seen it perform quite poorly. How well it performs will depend on the machine running the application and the frequency of the updates from the real-time Twitter stream. In later posts I&#8217;ll provide information on how to improve performance by making changes to the client code and I&#8217;ll also go into what can be done on the server.</div>
<h3>Download</h3>
<p>You can download the source from the <a  href="http://code.google.com/p/tweetstreamer/">TweetStreamer Google Code project</a>.<br />
<a name="screencast"></a></p>
<h2>Screencast</h2>
<p>This screencast was supposed to be short but ended up being just shy of 10 minutes. In it I provide some technical detail of how I built the application, show the basics of how Fiddler is used to give access to the Twitter real-time data stream, and give a demo of the application.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="625" height="505" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/5T_jiZCzg4U&amp;hl=en&amp;fs=1&amp;rel=0&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="625" height="505" src="http://www.youtube.com/v/5T_jiZCzg4U&amp;hl=en&amp;fs=1&amp;rel=0&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;title=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F11%2F03%2Fa-real-time-rich-internet-application-rtria-example.html&amp;t=A+Real+Time+Rich+Internet+Application+%28RTRIA%29+Example" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Permanent Link: Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
<li><a href='http://www.leggetter.co.uk/2009/11/07/which-rich-internet-application-technology-will-dominate.html' rel='bookmark' title='Permanent Link: Which Rich Internet Application Technology will dominate?'>Which Rich Internet Application Technology will dominate?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html' rel='bookmark' title='Permanent Link: Using Fiddler to trick Silverlight into allowing a crossdomain Web Request'>Using Fiddler to trick Silverlight into allowing a crossdomain Web Request</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/11/03/a-real-time-rich-internet-application-rtria-example.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Fiddler to trick Silverlight into allowing a crossdomain Web Request</title>
		<link>http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html</link>
		<comments>http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html#comments</comments>
		<pubDate>Fri, 30 Oct 2009 11:06:06 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[RTRIA]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=425</guid>
		<description><![CDATA[If you are trying to make a web request from a Silverli [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2008/10/24/how-to-make-a-cross-domain-web-request-with-silverlight-2.html' rel='bookmark' title='Permanent Link: How to make a cross domain web request with SilverLight 2'>How to make a cross domain web request with SilverLight 2</a></li>
<li><a href='http://www.leggetter.co.uk/2010/02/05/silverlight-uses-xcp-tmp-files-for-web-requests.html' rel='bookmark' title='Permanent Link: Silverlight uses XCP tmp files for Web Requests'>Silverlight uses XCP tmp files for Web Requests</a></li>
<li><a href='http://www.leggetter.co.uk/2010/03/19/using-fiddler-to-help-develop-cross-domain-capable-javascript-web-applications.html' rel='bookmark' title='Permanent Link: Using Fiddler to help develop cross domain capable JavaScript web applications'>Using Fiddler to help develop cross domain capable JavaScript web applications</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you are trying to make a web request from a Silverlight application the first thing the Silverlight runtime will do is request a security policy file (see <a  href="http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx">Network Security Access Restrictions in Silverlight</a>) from the root of the server you are making your web request to. This happens if you are making your request using the <a  href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.95).aspx">HttpWebRequest</a> or <a  href="http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.95).aspx">WebClient</a> class. If the Silverlight runtime fails to get a security policy file your web request will fail. If your Silverlight application relies on this web request then you are going to need to contact the server owner and get them to add a security file but until then you can use the <a  href="http://www.fiddler2.com/fiddler2/">Fiddler HTTP Proxy</a> to trick the Silverlight runtime into believing that it does have permission to make the request.<br />
<span id="more-425"></span><br />
<small>If you want to skip the explanation you can jump <a  href="#screencast">straight to the screencast</a></small></p>
<h2>How Silverlight makes a web request</h2>
<p>If you were making a web request from Silverlight to download the following page:</p>
<p><code><a  href="http://www.leggetter.co.uk/2009/10/23/how-i-approach-problem-solving-in-code.html" rel="nofollow">http://www.leggetter.co.uk/2009/10/23/how-i-approach-problem-solving-in-code.html</a></code></p>
<p>The Silverlight runtime would first request</p>
<p><code><a  href="http://www.leggetter.co.uk/clientaccesspolicy.xml" rel="nofollow">http://www.leggetter.co.uk/clientaccesspolicy.xml</a></code></p>
<p>If this request fails it will then request</p>
<p><code><a  href="http://www.leggetter.co.uk/crossdomain.xml" rel="nofollow">http://www.leggetter.co.uk/crossdomain.xml</a></code></p>
<p>If both of these requests fail (return a 404 HTTP status) the Silverlight runtime will not allow you to make your web request. *</p>
<p><small>* Note: The web request failure due to a failure to download a security policy file can manifest itself in a number of ways. I&#8217;ll try to remember to put a post up about this later.</small></p>
<p>The clientaccesspolicy.xml file is Microsoft&#8217;s own security policy file. The crossdomain.xml file is used by Adobe Flash but is also supported by Silverlight. For more information see <a  href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e08.html#WS366737CC-0BD3-47b4-8292-569FB3AA276B">master-policy file</a>.</p>
<p>Now that we&#8217;ve got the background information out of the way we can get on to the interesting stuff.</p>
<h2>An example using the Twitter Streaming Feed</h2>
<p>If you wanted to write your own <a  href="http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html">Real-Time Rich Internet Application (RTRIA)</a> that consumed data from the <a  href="http://apiwiki.twitter.com/Streaming-API-Documentation">Twitter real-time data stream</a> you&#8217;d be stuck. Well, you&#8217;ll be stuck until Twitter puts a security policy file up **. Until then you can trick the Silverlight runtime by using <a  href="http://www.fiddler2.com/fiddler2/">Fiddler</a> to detect the security policy file request and fake a response.</p>
<p><small>**  The following URLs are where Twitter would put their security policy files should they decide to allow cross domain access. Please not that you&#8217;ll be prompted for your Twitter username and password if you click on them by the browser because you need to sign in with valid twitter credentials to access the twitter <em>stream</em> domain: <a  href="http://stream.twitter.com/clientaccesspolicy.xml" rel="nofollow">http://stream.twitter.com/clientaccesspolicy.xml</a> and <a  href="http://stream.twitter.com/crossdomain.xml)" rel="nofollow">http://stream.twitter.com/crossdomain.xml)</a></small></p>
<p>To do this you will need to set up an <a  href="http://www.fiddler2.com/Fiddler2/help/AutoResponder.asp">AutoResponder</a> in Fiddler that intercepts the request for the security policy file by the Silverlight runtime and returns a fake security policy file. In the example below I have an AutoResponder set up for <code><a  href="http://stream.twitter.com/crossdomain.xml" rel="nofollow">http://stream.twitter.com/crossdomain.xml</a></code>.</p>
<div id="attachment_426" class="wp-caption alignnone" style="width: 310px"><a  title="Using Fiddler to AutoRespond with a fake Security Policy File " href="http://www.leggetter.co.uk/wp-content/uploads/2009/10/UsingFiddlerToAutoRespondWithAFakeSecurityPolicyFile.png" class="thickbox no_icon" rel="gallery-425"><img class="size-medium wp-image-426 " title="UsingFiddlerToAutoRespondWithAFakeSecurityPolicyFile" src="http://www.leggetter.co.uk/wp-content/uploads/2009/10/UsingFiddlerToAutoRespondWithAFakeSecurityPolicyFile-300x195.png" alt="Using Fiddler to AutoRespond with a fake Security Policy File" width="300" height="195" /></a><p class="wp-caption-text">Using Fiddler to AutoRespond with a fake Security Policy File</p></div>
<p>Here&#8217;s an example of a crossdomain.xml security policy file which grants access to requests from all domains.</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE cross-domain-policy
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
&lt;cross-domain-policy&gt;
  &lt;allow-access-from domain="*" /&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>Once you&#8217;ve set up the AutoResponder start Fiddler. Then start your Silverlight application that is trying to stream data from Twitter and bingo! You should have real-time data from Twitter in your RIA &#8211; a Real-Time Rich Internet Application (RTRIA).</p>
<p><a name="screencast"></a></p>
<h2>Fiddler HTTP Proxy Screencast</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/NXSmH9aWxeo&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/NXSmH9aWxeo&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;title=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F30%2Fusing-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html&amp;t=Using+Fiddler+to+trick+Silverlight+into+allowing+a+crossdomain+Web+Request" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2008/10/24/how-to-make-a-cross-domain-web-request-with-silverlight-2.html' rel='bookmark' title='Permanent Link: How to make a cross domain web request with SilverLight 2'>How to make a cross domain web request with SilverLight 2</a></li>
<li><a href='http://www.leggetter.co.uk/2010/02/05/silverlight-uses-xcp-tmp-files-for-web-requests.html' rel='bookmark' title='Permanent Link: Silverlight uses XCP tmp files for Web Requests'>Silverlight uses XCP tmp files for Web Requests</a></li>
<li><a href='http://www.leggetter.co.uk/2010/03/19/using-fiddler-to-help-develop-cross-domain-capable-javascript-web-applications.html' rel='bookmark' title='Permanent Link: Using Fiddler to help develop cross domain capable JavaScript web applications'>Using Fiddler to help develop cross domain capable JavaScript web applications</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Real-Time Rich Internet Applications (RTRIA)</title>
		<link>http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html</link>
		<comments>http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html#comments</comments>
		<pubDate>Thu, 29 Oct 2009 10:15:06 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[pubsubhubbub]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[rssCloud]]></category>
		<category><![CDATA[RTRIA]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=456</guid>
		<description><![CDATA[Real-Time Rich Internet Applications (RTRIAs) are RIAs  [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/11/07/which-rich-internet-application-technology-will-dominate.html' rel='bookmark' title='Permanent Link: Which Rich Internet Application Technology will dominate?'>Which Rich Internet Application Technology will dominate?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/12/01/the-christmascrunch-nearly-real-time-web-event.html' rel='bookmark' title='Permanent Link: The ChristmasCrunch nearly real-time web event'>The ChristmasCrunch nearly real-time web event</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html' rel='bookmark' title='Permanent Link: Using Fiddler to trick Silverlight into allowing a crossdomain Web Request'>Using Fiddler to trick Silverlight into allowing a crossdomain Web Request</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Real-Time Rich Internet Applications</strong> (<strong>RTRIA</strong>s) are <a  href="http://en.wikipedia.org/wiki/Rich_Internet_application">RIA</a>s that consume and display real-time data. They have all the characteristics of an RIA with the added feature that data is being pushed to them in real-time as soon as it becomes available. This is in contrast to the current polling solution employed by most RIAs or other web applications that display updating data.</p>
<p>I mentioned <strong>RTRIA</strong>s for the first time back in April 2009 in a post called &#8220;<a  href="http://blog.caplin.com/2009/04/20/what-is-the-real-time-web/">What is the real-time web</a>&#8221; on the Caplin Systems Platformability blog, and since then there has been a real-time web explosion. The &#8220;real-time web&#8221; is now <strong>the</strong> buzz phrase around the Internet that everybody is jumping on. Back in April I set up a <a  href="http://www.google.com/alerts">Google Alert</a> for the term &#8220;real-time web&#8221;. Back then I got maybe one Google Alert a day for this term, probably less. Now, I get at least two dense emails a day from Google with people using the term for all sorts of things; real-time web stats, real-time analytics, real-time search, <a  href="http://rsscloud.org/">rssCloud</a>, <a  href="http://code.google.com/p/pubsubhubbub/">pubsubhubbub</a>, the list goes on. <em>This is not the real-time web!</em> Whilst some of the things on this list will help  the web become <em>truly real-time</em> (rssCloud and pubsubhubbub may even form the back bone), none of these things give the user a truly real-time web experience.</p>
<p><span id="more-456"></span></p>
<p>My opinion about what the real-time web is has not changed from that <a  href="http://blog.caplin.com/2009/04/20/what-is-the-real-time-web/">first blog post</a>. For me, it&#8217;s not just about <em>data being available</em> as soon as it&#8217;s been published. In this situation the user still has to actively make a request to see if any data is available. Instead it&#8217;s about making a single request for data (a <em>subscription</em>) and that data being pushed to your RIA to be consumed by the application user in real-time. Quite a few applications have implemented a polling solution (more on this later) but the experience presented to the user is not <em>truly real-time</em>.</p>
<div id="attachment_463" class="wp-caption alignnone" style="width: 669px"><a  href="http://www.leggetter.co.uk/wp-content/uploads/2009/10/real-time-web-twitter-search.png" class="thickbox no_icon" rel="gallery-456" title="Twitter &quot;real-time web&quot; search results"><img class="size-full wp-image-463" title="Twitter &quot;real-time web&quot; search results" src="http://www.leggetter.co.uk/wp-content/uploads/2009/10/real-time-web-twitter-search.png" alt="&quot;Real-Time&quot;" width="659" height="429" /></a><p class="wp-caption-text">&quot;Real-Time?&quot;</p></div>
<p>In my opinion the only way to guarantee being able to deliver <em>truly real-time data</em> (<strong>TRTD</strong>) to a web application is by maintaining a streaming connection to the source of the data using a <em>continuous</em> streaming HTTP connection. Most web applications use a technique called polling or <a  href="http://en.wikipedia.org/wiki/Push_technology#Long_polling">long polling</a> to retrieve their data which means that although the data is initially &#8220;fresh&#8221;, within seconds it could be out of date, or more information may be available. I&#8217;ll discuss server technologies further in a later post.</p>
<p>At the moment there are a number of technologies that allow you to develop RTRIAs. <a  href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a>, <a  href="http://www.microsoft.com/SILVERLIGHT/overview/default.aspx">Silverlight</a> and <a  href="http://www.adobe.com/flashplatform/">Flash</a> are the three mainstream solutions. The core barriers to RTRIAs are the scalability of server technology and access to truly real-time data.</p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;title=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Real-Time+Rich+Internet+Applications+%28RTRIA%29+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F10%2F29%2Freal-time-rich-internet-applications-rtria.html&amp;t=Real-Time+Rich+Internet+Applications+%28RTRIA%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/11/07/which-rich-internet-application-technology-will-dominate.html' rel='bookmark' title='Permanent Link: Which Rich Internet Application Technology will dominate?'>Which Rich Internet Application Technology will dominate?</a></li>
<li><a href='http://www.leggetter.co.uk/2009/12/01/the-christmascrunch-nearly-real-time-web-event.html' rel='bookmark' title='Permanent Link: The ChristmasCrunch nearly real-time web event'>The ChristmasCrunch nearly real-time web event</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/30/using-fiddler-to-trick-silverlight-into-allowing-a-crossdomain-web-request.html' rel='bookmark' title='Permanent Link: Using Fiddler to trick Silverlight into allowing a crossdomain Web Request'>Using Fiddler to trick Silverlight into allowing a crossdomain Web Request</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
