<?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 - Real-Time Web Software and Technology Evangelist &#187; JavaScript</title>
	<atom:link href="http://www.leggetter.co.uk/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.leggetter.co.uk</link>
	<description>Real-Time Web, Real-Time Data and Social Media Software and Technology Evangelist and Consultant</description>
	<lastBuildDate>Sun, 29 Jan 2012 05:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>JavaScript namespace utility</title>
		<link>http://www.leggetter.co.uk/2011/08/23/javascript-namespace-utility.html</link>
		<comments>http://www.leggetter.co.uk/2011/08/23/javascript-namespace-utility.html#comments</comments>
		<pubDate>Tue, 23 Aug 2011 16:09:24 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=21748</guid>
		<description><![CDATA[<p>Over the past 10 or so years I&#8217;ve written a lot of JavaScript. From very early on, at <a href="http://www.caplin.com">Caplin Systems</a>, I had to write things in a way which ensured that code was clear, usable, discoverable, reusable, extensible and can easily built upon. One of the concepts that was used was to put code [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html' rel='bookmark' title='Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest'>Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest</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='Using Fiddler to help develop cross domain capable JavaScript web applications'>Using Fiddler to help develop cross domain capable JavaScript web applications</a></li>
<li><a href='http://www.leggetter.co.uk/2005/06/30/a-career-using-javascript.html' rel='bookmark' title='A Career Using JavaScript'>A Career Using JavaScript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the past 10 or so years I&#8217;ve written a lot of JavaScript. From very early on, at <a  href="http://www.caplin.com">Caplin Systems</a>, I had to write things in a way which ensured that code was clear, usable, discoverable, reusable, extensible and can easily built upon. One of the concepts that was used was to put code within a namespace. This ensured that you couldn&#8217;t accidentally override a function in the global <code>window</code> namespace and also meant that the namespace would describe the sort of functionality contained within. I&#8217;ve continued to use this concept in various forms but just realised that I&#8217;ve never actually shared how I do this. So here goes.</p>
<p>It&#8217;s actually really simple. I&#8217;ve got two functions that I use, and I&#8217;ve recently ported over to the <code>com.pusher</code> namespace since I&#8217;m creating demos for my work (and play). The first creates some default namespace objects and then defines a <code>namespace</code> function that can be used from then on to create any other namespace objects.</p>
<pre><code>/**
 * @namespace
 * Top-level namespace to stop namespace clutter.
 */
if(!window["com"]) {
  window["com"] = {};
}

// create pusher ns
if(!com.pusher) {
  com.pusher = {};
}

/**
 * Ensures that a namespace exists.
 * @param {String} namespace The namespace to check for and create if required.
 *
 * @return {Object} The existing or new namespace.
 */
com.pusher.namespace = function(namespace) {
  var parts = namespace.split(".");
  var context = window;
  var nsPath = "";
  for(var i = 0, l = parts.length; i &lt; l; ++i) {
    var name = parts[i];
    if(!context[name]) {
      context[name] = {};
      context[name].__namespace = name;
    }
    nsPath += name + ".";
    context = context[name];
    if(!context.__namespace) {
      context.__namespace = nsPath.substring(0, nsPath.length-1); // trim off '.'
    }
  }
  return context;
};
</code></pre>
<p>A quick example of this might be:</p>
<pre><code>com.pusher.namespace("my.new.namespace");

my.new.namespace.SomeClass = function() {
};
/* define methods etc. */
</code></pre>
<p>Then you can access the class anywhere using:</p>
<pre><code>var instance = new my.new.namespace.SomeClass();
</code></pre>
<p>The second function that I&#8217;ve only just started to use takes a leaf from <strong>node.js</strong>. It in that it passes in an <code>exports</code> variable which represents the newly created namespace and then you can add items to that namespace.</p>
<p><em>Note: I&#8217;d previously called the <code>exports</code> variable called <code>export</code> but it would appear this is a reserved word in Safari &amp; Firefox</em></p>
<pre><code>com.pusher.define = function(namespace, definition) {
  var exports = {};
  definition(exports);

  var nsObject = com.pusher.namespace(namespace);
  for(var thingToexports in exports) {
    nsObject[thingToexports] = exports[thingToexports];
  }
};
</code></pre>
<p>You&#8217;ll noticed that it uses the <code>com.pusher.namespace</code> function to create the namespace object. The usage of this is then as follows:</p>
<pre><code>com.pusher.namespace("my.new.namespace", function(exports) {

  var SomeClass = function() {
  };
  /* define methods etc. */

  exports.SomeClass = SomeClass;
});
</code></pre>
<p>The class can then be accessed in the same way as shown previously:</p>
<pre><code>var instance = new my.new.namespace.SomeClass();
</code></pre>
<p>I like this last way of doing things as you declare the namespace at the top and wrap everything in a function. You then can pick what you want to expose to the outside world by just adding it to the <code>exports</code> variable.</p>
<p>I&#8217;d be interested to hear what you think about this approach. Do you have a better one?</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html' rel='bookmark' title='Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest'>Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest</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='Using Fiddler to help develop cross domain capable JavaScript web applications'>Using Fiddler to help develop cross domain capable JavaScript web applications</a></li>
<li><a href='http://www.leggetter.co.uk/2005/06/30/a-career-using-javascript.html' rel='bookmark' title='A Career Using JavaScript'>A Career Using JavaScript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2011/08/23/javascript-namespace-utility.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Notes on Falsy Values</title>
		<link>http://www.leggetter.co.uk/2011/05/24/notes-on-falsy-values.html</link>
		<comments>http://www.leggetter.co.uk/2011/05/24/notes-on-falsy-values.html#comments</comments>
		<pubDate>Tue, 24 May 2011 21:32:59 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Falsy Values]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[pusher]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=16125</guid>
		<description><![CDATA[<p>I spent the majority of last week in Warsaw at <a href="http://falsyvalues.com">Falsy Values</a> where I attended a Games Workshop and a conference day. It was also my first week working as a Developer Evangelist working for <a href="http://pusher.com">Pusher</a>. A big and exciting week all round.</p> HTML5 Games Workshop <p>The HTML5 games workshop was ran by [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I spent the majority of last week in Warsaw at <a  href="http://falsyvalues.com">Falsy Values</a> where I attended a Games Workshop and a conference day. It was also my first week working as a Developer Evangelist working for <a  href="http://pusher.com">Pusher</a>. A big and exciting week all round.</p>
<h3>HTML5 Games Workshop</h3>
<p>The HTML5 games workshop was ran by <a  href="http://twitter.com/kuvos">@kuvos</a> and <a  href="http://twitter.com/pornelski">@pornelski</a> and we went through building a game of Tetris and then <a  href="http://qfox.nl/weblog/232">Mario</a>. I was very impressed to see what can be achieved with Canvas and the workshop provided a lot of food for thought about the sorts of things that would be really useful to HTML5 games developers. Watch this space, and the <a  href="http://blog.pusherapp.com/2011/5/22/pusher-at-falsy-values">Pusher blog</a>.</p>
<h3>The Keynote</h3>
<div id="attachment_16127" class="wp-caption aligncenter" style="width: 235px"><a  href="http://www.leggetter.co.uk/wp-content/uploads/2011/05/pusher_crockford.jpg" class="thickbox no_icon" rel="gallery-16125" title="Douglas Crockford at Falsy Values - and a Pusher banner!"><img class="size-medium wp-image-16127" title="Douglas Crockford at Falsy Values - and a Pusher banner!" src="http://www.leggetter.co.uk/wp-content/uploads/2011/05/pusher_crockford-225x300.jpg" alt="Douglas Crockford at Falsy Values - and a Pusher banner!" width="225" height="300" /></a><p class="wp-caption-text">Douglas Crockford at Falsy Values - and a Pusher banner!</p></div>
<p>The morning of the conference day saw a few fuzzy heads from the Pusher party the night before, but they soon cleared as <a  href="http://www.crockford.com/">Douglas Crockford</a> delivered the keynote. He covered the good and bad parts of JavaScript and how, as developers, we need to us a combination of head and gut (instinct) when writing code. <a  href="http://www.jslint.com/">JSLint</a> got a number of mentions and Douglas stressed the importance of following coding practices. He explained that just because JavaScript lets us do something, it doesn’t mean we should necessarily do it.  Here are a couple of examples:</p>
<h4>Always use treble equals for comparisons</h4>
<pre class="brush: jscript; title: ; notranslate">
if(myVar === 0) {
}
</pre>
<p>Many of us already know that double equals can lead to problems. 0 compared with an empty string will evaluate to try, undefined compared with null will evaluate to true and a number of no so obvious examples:</p>
<pre class="brush: jscript; title: ; notranslate">
&quot;0&quot; == 0 // true
&quot;00&quot; == false // true
true == 1 // true
undefined == null // true
</pre>
<p>Therefore Douglas believes it’s best practice to always use treble equals so that the code intent is absolutely clear.</p>
<h4>Put curly brackets after parenthesis</h4>
<pre class="brush: jscript; title: ; notranslate">
function myFunc() {
}
</pre>
<p>This was a hard one to swallow as I like to put my parenthesis on the left &#8211; on the next line. However, Douglas provided an example which made me realise that it could be a bad thing.</p>
<pre class="brush: jscript; title: ; notranslate">
function buildObjectLiteral()
{
   return // this returns!
   {
      &quot;someProperty&quot;: &quot;hello&quot;
   };
}
</pre>
<p>The interesting thing here is that undefined will be returned because a line break is also ends a statement in JavaScript. I don’t think I would actually ever do this. I would probably assign the object literal to a variable first and then return it. However, if I didn’t follow this rule I might make the above mistake. If it can happen then the easiest way to avoid it is just don’t do it. So, curly brackets now go on the same line – on the right.</p>
<h3>Do the right thing</h3>
<p>Douglas explained that he has made some changes to his coding practices recently. A developer had contacted him asking if JSLint should report a problem if it found a switch statement that allowed any code to fall through between cases. Although he had a gut feeling that it was probably not a good thing to do he believed that it would “hardly ever” cause a problem. Some time later the developer got back to Douglas saying he’d found a bug in JSLint. The bug was causes by a switch statement which allowed code to fall through cases. Doug has now formed the opinion that if something can cause a problem, even if it’s unlikely, that the best practice is don’t do it.</p>
<pre class="brush: jscript; title: ; notranslate">
switch(test)  {
   case 0:
      // don’t do it!
   case 1:
      break;
   case 2:
      break;
}
</pre>
<h3>When will ECMAScript 6 reach the web browser?</h3>
<p><a  href="http://twitter.com/#%21/dmitrysoshnikov">Dmitry Soshnikov</a> gave a talk on <a  href="http://wiki.ecmascript.org/doku.php">ECMAScript 6</a>, codename Harmony. Whilst there seem like some good ideas going to to ES6 the question remains when will anybody actually be able to use it in a web browser? It will probably a be available in <a  href="http://nodejs.org/">node.js</a> before it&#8217;s most browser runtimes. It also sounded like a lot of syntactical things were being drawn from Erlang &#8211; not sure about this.</p>
<p>Slides: <a  href="http://www.slideshare.net/dmitrysoshnikov/falsyvalues-dmitry-soshnikov-ecmascript-6">http://www.slideshare.net/dmitrysoshnikov/falsyvalues-dmitry-soshnikov-ecmascript-6</a></p>
<h3>Fabric.js &#8211; the new defacto JS Library for Canvas?</h3>
<p>I didn&#8217;t sit through this talk as I had to pop out and get some work done and thought my tapping on a keyboard would annoy those around me. However, whilst in the games workshop it was very clear that it&#8217;s unlikely that people would be accessing the Canvas API directly and that, in the same way that very few people use document.getElementById, very few people will directly call canvas.getContext(&#8220;2d&#8221;) &#8211; they use a library that offers richer functionality to the developer. <a  href="http://kangax.github.com/fabric.js/test/demo/">Fabric.js</a> provides exactly that.</p>
<p>The talk was given by <a href="twitter.com/kangax">Juriy &#8220;kangax&#8221; Zaytsev</a> on Fabric.js and you can check out the demos from here:<br />
<a  href="http://kangax.github.com/fabric.js/test/demo/">http://kangax.github.com/fabric.js/test/demo/</a></p>
<h3>JavaScript JIT</h3>
<p><a  href="http://twitter.com/#%21/zbraniecki">Zbigniew Braniecki</a> of Mozilla gave a really interesting talk about JavaScript engine Just-in-time compilation methods. There are two types of compilation, method and tracing. Here&#8217;s how I understand they work. Method counts the number of times a method is called and if it reaches a certain number of calls then the method is compiled (no longer interpreted). Tracing analysis code paths and compiles code paths that are commonly executed. Apparently there is very little documentation on this and Zbigniew had to do a lot of work to find out which methods each browser uses and to come up with the slides.</p>
<p>The point of his talk was that we can actually help compilers make our apps faster by writing code with the compilers in mind. In most cases this won&#8217;t be necessary but if you are trying to squeeze that extra bit of performance out of your app it&#8217;s something you might consider.</p>
<p>Slides: <a  href="http://www.slideshare.net/zbraniecki/js-compilation-falsy-values-slides">http://www.slideshare.net/zbraniecki/js-compilation-falsy-values-slides</a></p>
<h3>PhoneGap</h3>
<p>Unfortunately I missed this one but it was delivered by <a  href="http://twitter.com/#%21/BrianLeRoux">Brian LeRoux</a> and he demonstrated how to build an app in PhoneGap. Go check out <a  href="http://www.phonegap.com/">PhoneGap</a>, it sounds super useful.</p>
<h3>Has JavaScript won?</h3>
<p>There were two other presentations, first <a  href="http://twitter.com/#%21/sh1mmer">Tom Hughes-Croucher</a> on <a  href="http://nodejs.org/">node.js</a>, who also ran the node.js workshop on the first two days, and finally <a  href="http://twitter.com/#%21/t">Tantek Çelik</a> talking about his new project <a  href="http://tantek.pbworks.com/w/page/19402872/CassisProject">CASSIS</a> which defines a sub-set of JavaScript which can run both in JavaScript and PHP. As I mention in my post about Falsy Values on the Pusher blog, right now is a great time to be a JavaScript developer. You can now developer server applications, in the browser, for mobile devices and also for the desktop.</p>
<p>It&#8217;s really strange to think that in 2004 I left a job because I was doing purely JavaScript and I wasn&#8217;t sure the language was going anywhere. How wrong was I? <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally, a big thanks to <a  href="http://twitter.com/#%21/czerskip">Pawe? Czerski</a> and <a  href="http://twitter.com/#%21/varjs">Damian Wielgosik</a> who organised Falsy Values. Well done guys!</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2011/05/24/notes-on-falsy-values.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Looking for a C# (ASP.NET MVC), jQuery &amp; Real-Time Web Contractor</title>
		<link>http://www.leggetter.co.uk/2011/03/23/looking-for-a-c-javascript-real-time-web-contractor.html</link>
		<comments>http://www.leggetter.co.uk/2011/03/23/looking-for-a-c-javascript-real-time-web-contractor.html#comments</comments>
		<pubDate>Wed, 23 Mar 2011 09:45:04 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Job]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://leggetter.posterous.com/looking-for-a-c-javascript-real-time-web-cont</guid>
		<description><![CDATA[        
	I&#039;m very hopeful that I&#039;ll be looking to hire a contractor very soon and I thought I would post this to get a feeling for who is out there and interested. The skills I&#039;m looking for are as follows:EssentialC#Advanced JavaScriptTD...
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/01/31/drag-drop-bug-in-jquery-ui-153.html' rel='bookmark' title='Drag Drop bug in JQuery UI 1.5.3'>Drag Drop bug in JQuery UI 1.5.3</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
<li><a href='http://www.leggetter.co.uk/2011/01/20/the-real-time-web-techmeetup-aberdeen-19012011.html' rel='bookmark' title='The Real-Time Web: TechMeetup Aberdeen &#8211; 19/01/2011'>The Real-Time Web: TechMeetup Aberdeen &#8211; 19/01/2011</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m looking for a contractor for a provisional 3 month contract with the following skills, experience and interests:</p>
<p><strong>Essential</strong></p>
<ul>
<li>C#</li>
<li>jQuery</li>
<li>TDD/BDD</li>
<li>ASP.NET MVC</li>
<li>ADO.NET Entity Framework or other ORM</li>
</ul>
<p><strong>Great to have</strong></p>
<ul>
<li>Passionate about the real-time web and real-time data (essential for the longer term)</li>
<li>Knowledge of building scalable systems on Amazon Infrastructure</li>
<li>Experience of integrating with 3rd party payment systems and building basic ecommerce functionality</li>
<li>Experience of building a SaaS or IaaS offering</li>
<li>Interest/experience in API and Web Service development</li>
<li>Advanced JavaScript</li>
<li>CSS</li>
<li>Excited about HTML5</li>
<li>Part of a tech community</li>
</ul>
<p><strong>Location</strong></p>
<p>The role will be primarily home-based but at times we may need to meet around 2 to 3 times a week at a location that we agree on anywhere between or around Dundee and Edinburgh.</p>
<p>Moving forward I&#8217;m hopeful that this could develop into a fulltime role so it would be ideal if we could get somebody who was interested in this also.</p>
<p>If you are interested please <a  href="mailto:phil@kwwika.com">get in touch</a>&nbsp;with&nbsp;your availability and your rate.</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2009/01/31/drag-drop-bug-in-jquery-ui-153.html' rel='bookmark' title='Drag Drop bug in JQuery UI 1.5.3'>Drag Drop bug in JQuery UI 1.5.3</a></li>
<li><a href='http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html' rel='bookmark' title='Real-Time Rich Internet Applications (RTRIA)'>Real-Time Rich Internet Applications (RTRIA)</a></li>
<li><a href='http://www.leggetter.co.uk/2011/01/20/the-real-time-web-techmeetup-aberdeen-19012011.html' rel='bookmark' title='The Real-Time Web: TechMeetup Aberdeen &#8211; 19/01/2011'>The Real-Time Web: TechMeetup Aberdeen &#8211; 19/01/2011</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2011/03/23/looking-for-a-c-javascript-real-time-web-contractor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kwwika Powered Real-Time Opta Sports Cricket Widget</title>
		<link>http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html</link>
		<comments>http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html#comments</comments>
		<pubDate>Fri, 17 Dec 2010 01:54:00 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cricket]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Kwwika]]></category>
		<category><![CDATA[Matador Digital]]></category>
		<category><![CDATA[Opta Sports]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://blog.kwwika.com/kwwika-powered-real-time-opta-sports-cricket</guid>
		<description><![CDATA[        
	Over the past couple of weeks we've been involved in developing a Real-Time Cricket widget. It's been a collaboration, with Opta Sports providing the data, Kwwika powering the real-time client push as well as doing a bit of dev on data archi...
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/01/07/marriage-worklife-integration-real-time-web-technology-evangelism-kwwika-a-retrospective-of-my-2010.html' rel='bookmark' title='Marriage, Work/life integration, real-time web technology evangelism &amp; Kwwika: A retrospective of my 2010'>Marriage, Work/life integration, real-time web technology evangelism &#038; Kwwika: A retrospective of my 2010</a></li>
<li><a href='http://www.leggetter.co.uk/2011/08/04/adding-a-real-time-whos-shopping-widget-to-an-asp-net-web-app.html' rel='bookmark' title='Adding a real-time &quot;Who&#8217;s shopping?&quot; widget to an ASP.NET Web App'>Adding a real-time &quot;Who&#8217;s shopping?&quot; widget to an ASP.NET Web App</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the past couple of weeks we&#8217;ve been involved in developing a Real-Time Cricket widget. It&#8217;s been a collaboration, with <a  href="http://www.optasports.com/">Opta Sports</a> providing the data, Kwwika powering the real-time client push as well as doing a bit of dev on data architecture and feed parsing and <a  href="http://www.matadorgroup.co.uk/">Matador Digital</a> helping us build the widget itself.</p>
<div id="ashes_3rd_test"></div>
<p><script src="http://kwwika-cdn.s3.amazonaws.com/widgets/opta/cricket/opta.cricket.js"></script><br />
<script>
opta.cricket.widget("#ashes_3rd_test",
    {
        style:"scorecard",
        gameDirectory:"/opta/cricket/fixtures/icc_world_cup_2011/20110330/semi_final_2"
    }
);
</script></p>
<style>
.opta-kwwika-score { color: white; }.opta-kwwika-news p { margin-top: 10px; }
</style>
<p>There&#8217;s quite a bit of work gone into this widget in a short space of time and I&#8217;m really pleased with the result. I&#8217;ll go into exactly how it was built in more detail in a later post but for now i&#8217;ll focus on what the widget can do and be used in this post.</p>
<h2>Features</h2>
<p>Opta Sports have created a an <a  href="http://www.optasports.com/sports/cricket/internet-and-mobile/live-scores-centre.html">overview page for the widget</a> which details the features at a higher level but I&#8217;m going to drill down a little bit deeper into the tech and explain how easily the widget can be embedded on any website.</p>
<h3>Real-time ball-by-ball updates</h3>
<p>For each event that occurs within a cricket match Opta Sports generate a feed. We get this feed, parse it and push it through Kwwika and into the web page. This means that every event is displayed on the widget.</p>
<h3>Show either full scoreboard or simple match status</h3>
<p>Ok, we finally get to see how you embed the widget in your page. It&#8217;s simple!</p>
<pre class="brush: jscript; title: ; notranslate">opta.cricket.widget(&quot;#scorecard-wrapper&quot;,
    {
        style:&quot;scorecard&quot;,
        gameDirectory:&quot;/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101226/4TH_TEST&quot;
    }
);</pre>
<p>The first parameter you pass to the <em>opta.cricket.widget</em> function is a <a  href="http://api.jquery.com/category/selectors/">jQuery selector</a>. This tells the widget where it should be created. If the selector matches multiple elements then you&#8217;ll get multiple widgets. You probably wouldn&#8217;t want this but it&#8217;s a cool trick. The widget will replace the contents of the selected element(s) so until the widget loads you can have some HTML that says the widget is loading or just some static cricket data. If the widget can&#8217;t load for any reason then the contents of the element(s) won&#8217;t be replaced. This won&#8217;t happen though <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The second parameter is options for the widget. We have a number of options that we support but the example above shows:</p>
<ul>
<li><strong>style</strong>: The widget can be created in a number of forms and this option parameter indicates how the widget should be displayed:
<ul style="margin-left: 40px;">
<li><strong>scorecard:</strong> This style is the full scorecard for an innings. This displays an overview section and all batsman and bowler information.</li>
<li><strong>mini</strong>: This style is very similar to the scorecard. It displays the overview section and just the batsman and bowlers that are active.</li>
<li><strong>overview</strong>: This style shows just the overview section of the widget.</li>
<li><strong>livescores</strong>: This style just shows the current score in a smaller widget area.</li>
</ul>
</li>
<li><strong>gameDirectory</strong>: This identifies the Kwwika topic to request for the game and the data for this game will be displayed in the widget. The following topic is used for the 3rd test of the Australia v England Ashes 2010 to 2011 series: /OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101216/3RD_TEST</li>
</ul>
<p><a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/fqabufgjhfeIiblgbDuhmdutxwnhhIpEyxkcEkDAnihxxGqezBscnbcmDssz/overview_green.png.scaled1000.png" rel="opta-style-examples" class="thickbox no_icon" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/fqabufgjhfeIiblgbDuhmdutxwnhhIpEyxkcEkDAnihxxGqezBscnbcmDssz/overview_green.png.scaled500.png" alt="" width="500" height="143" /></a><br />
<a href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/AaIGbcAzCqtttqnwAxcaiziksaEeEqBltzrpjGgoGwbCJcfuzevuyBBtCget/mini_green.png.scaled1000.png"rel="opta-style-examples"><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/AaIGbcAzCqtttqnwAxcaiziksaEeEqBltzrpjGgoGwbCJcfuzevuyBBtCget/mini_green.png.scaled500.png" alt="" width="500" height="336" /></a><br />
<img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/JIEGhhBxpDDhlmBJlJoAEtfyIixuEFiCkjGfsvBogGDcvelwguabhwzdtJga/livescore_green.png.scaled500.png" alt="" width="283" height="205" /><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/ussuJCHuyjacpcBexmqJqzxAhGvmffbsCfnloGbqxldJeICcIsicEakJdvms/OptaCricketWidget-Scorecard.png.scaled1000.png" rel="opta-style-examples" class="thickbox no_icon" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/ussuJCHuyjacpcBexmqJqzxAhGvmffbsCfnloGbqxldJeICcIsicEakJdvms/OptaCricketWidget-Scorecard.png.scaled500.png" alt="" width="500" height="571" /></a></p>
<p><a  href="http://blog.kwwika.com/kwwika-powered-real-time-opta-sports-cricket">See and download the full gallery on posterous</a></p>
<p>We also have a few other option parameters:</p>
<ul>
<li><strong>innings</strong>: The widget defaults to displaying the latest available information. However, we cache some of the cricket data so it&#8217;s possible to display the data for an earlier innings from a match by passing in an innings number.</li>
<li><strong>flashTime</strong>: When an update occurs such as a run being scored or a bowler bowling a batsman out we flash the widget. This allows you to set how long the flash will last for.</li>
<li><strong>title</strong>: This is displayed at the top of the widget if it is in the livescores style.</li>
<li><strong>topicErrorMsg</strong>: A bit techie. If you have entered a gameDirectory that doesn&#8217;t exist then the widget displays an error message. This allows you to configure what that error message says. It can contain HTML.</li>
</ul>
<h3>Developed using Kwwika technology for instant data streaming</h3>
<p>Yep, it&#8217;s the real-time web. Delivered <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Do you have any data that you want to instantly distribute to any web-enabled device? If so, <a  href="http://kwwika.com/contact">get in touch</a>.</p>
<h3>Easy to customise &#8211; apply your own styling and branding</h3>
<p>Since the widget is purely HTML and we&#8217;ve styled it with CSS you can easily customise the widget. <a  href="http://twitter.com/aaronbassett">Aaron Basset</a> of Matador Digital did a great job when I asked him to supply a few different stylesheets. He told me that he&#8217;d used <a  href="http://lesscss.org/">LESS</a> to generate the CSS for the widget so it was easy to create different styles. Within 15 minutes Aaron had sent 10 different styles my way. You can apply the different styles in our example pages by just changing the drop-down at the top-left of the page. My favourites are the Kill Bill or Comic styles.</p>
<p><a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/bpuxDEEHedsauwFcpltclDdbahcqbuhABjetFqtekCzoysvtgbqlAwsGyhws/comic.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/bpuxDEEHedsauwFcpltclDdbahcqbuhABjetFqtekCzoysvtgbqlAwsGyhws/comic.png.scaled500.png" alt="" width="500" height="523" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/qelyocjonkyDzsrcryweiwbsAaiIekFcyHIvCmbIvlhDDBhBqtGJtDClnHud/killbill.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/qelyocjonkyDzsrcryweiwbsAaiIekFcyHIvCmbIvlhDDBhBqtGJtDClnHud/killbill.png.scaled500.png" alt="" width="500" height="524" /></a><br />
<img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/IlpkhpAxwGvkDFCletdFAmhgviIznymklIcfqvxJByohDfEpkqsEGvsfsBzH/livescore_green.png.scaled500.png" alt="" width="283" height="205" /><br />
<img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/wqoiBBxAiEpJGcAbvziCedumtoadHietpzzgGwsbobCdAIJvjxlnHapFljFJ/livescore_orange.png.scaled500.png" alt="" width="279" height="198" /><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/paIuDDDyiyBaFJEmCtaFvwsAikHhyHIDyGnzwnzmhzFarptatbrjlhEqmAGH/mini_blue.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/paIuDDDyiyBaFJEmCtaFvwsAikHhyHIDyGnzwnzmhzFarptatbrjlhEqmAGH/mini_blue.png.scaled500.png" alt="" width="500" height="331" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/wkxjgCrczoDohsJdIsBwkpJnidegFrHdJBjBJpkJtghGrtaejEDFEdglreCd/mini_green.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/wkxjgCrczoDohsJdIsBwkpJnidegFrHdJBjBJpkJtghGrtaejEDFEdglreCd/mini_green.png.scaled500.png" alt="" width="500" height="336" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/kfHtxfsweExeurIpmcDdFnlwittrumwoJycyakEoxknGhIalqEIgixfDlydc/overview_bbcworld.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/kfHtxfsweExeurIpmcDdFnlwittrumwoJycyakEoxknGhIalqEIgixfDlydc/overview_bbcworld.png.scaled500.png" alt="" width="500" height="142" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/ArAexJeyzwiBbAIGsyknimvhmmgajiwyoArnwblrBBlboGHhzcnDItFvCHhH/mini_mono.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/ArAexJeyzwiBbAIGsyknimvhmmgajiwyoArnwblrBBlboGHhzcnDItFvCHhH/mini_mono.png.scaled500.png" alt="" width="500" height="329" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/tryiFlBvIlAHIogqEsAAxpqungcJBjIJoCAEtvmqBkdorviBkqDDgcJvAkwF/overview_terra.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/tryiFlBvIlAHIogqEsAAxpqungcJBjIJoCAEtvmqBkdorviBkqDDgcJvAkwF/overview_terra.png.scaled500.png" alt="" width="500" height="143" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/hmDnBAGsJdzhtodmlDfvjkphEkojJhHGyhqfhHmkiznorEEhJAbjtdzCkbHH/purple.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/hmDnBAGsJdzhtodmlDfvjkphEkojJhHGyhqfhHmkiznorEEhJAbjtdzCkbHH/purple.png.scaled500.png" alt="" width="500" height="528" /></a><br />
<a  href="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/jkCCnIDovIrHqgplumltIDFGuerfEkBGdrGkFgyvwDwicuBAcErIDDGoztyC/red.png.scaled1000.png" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/temp-2010-12-17/jkCCnIDovIrHqgplumltIDFGuerfEkBGdrGkFgyvwDwicuBAcErIDDGoztyC/red.png.scaled500.png" alt="" width="500" height="521" /></a></p>
<p><a  href="http://blog.kwwika.com/kwwika-powered-real-time-opta-sports-cricket">See and download the full gallery on posterous</a></p>
<h3>Can be embedded anywhere within the website with just three lines of code</h3>
<p>We&#8217;ve classed the HTML container element for the widget and the single widget script include as lines of code which bumps this up to 3 lines. I&#8217;ve used a number of widgets in the past and I think we&#8217;ve done a great job here.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;scorecard&quot;&gt;&lt;/div&gt;
&lt;script src=&quot;http://cdn.kwwika.com/widgets/opta/cricket/opta.cricket.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;opta.cricket.widget(&quot;#scorecard-wrapper&quot;, {style:&quot;mini&quot;, gameDirectory:&quot;/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101216/3RD_TEST&quot;});&lt;/script&gt;
</pre>
<p>Okay, that last line is a bit long and maybe counts as 4!</p>
<h3>Multiple matches on a single web page</h3>
<p>You can call <em>opta.cricket.widget</em> as many times as you like and for each call you could pass a different game directory. That way you could easily have multiple games displayed on the same web page if you liked. You could also mix the styles of widgets that are on a web page.</p>
<p><a  href="http://posterous.com/getfile/files.posterous.com/kwwika/tdvPG09HvkihLke9RWI2vTiDvFDnGfFUv8b0id1zl7RCZnhydwASztySV3zs/MixedWidgets.png.scaled.1000.jpg" class="thickbox no_icon" rel="gallery-3712" title=""><img src="http://posterous.com/getfile/files.posterous.com/kwwika/v84NgEWg0RAkrANR8v586ya1fFbq8fHmAEgNc4jgIgzhAzDkF48sFic98KPA/MixedWidgets.png.scaled.500.jpg" alt="" width="500" height="430" /></a></p>
<h2>I want that widget!</h2>
<p>Opta Sports specialise in high quality sports data. They have a number of sports products and this real-time cricket widget is the latest such product. Opta Sports are looking for companies who are interested in taking this widget and embedding it on their website or within their web application. If you are interested please <a  href="http://kwwika.com/contact">get in touch with us</a> or or directly with Opta Sports <a  href="http://www.optasports.com/sports/cricket/internet-and-mobile/live-scores-centre.html">via their cricket score centre page</a>.</p>
<p>Since the ashes are nearly at an end we will also consider allowing you to embed this widget free of charge on your website for the remaining Ashes matches. Just <a  href="http://kwwika.com/contact">get in touch</a>.</p>
<h2>I want the cricket data!</h2>
<p>One of the things that excites us about this widget is that we are now seeing high quality sports data streaming through our servers. We&#8217;ve also proven that Kwwika is a fantastic distribution channel for real-time data. And we&#8217;ve seen that the delivery speeds between the data being captured and appearing on a web page are fantastic! We hope that this is the start of a big DAAS (Data as a Service) trend and that Kwwika can be at the forefront of it.</p>
<p>If you like the widgets but you&#8217;d love to just get hold of the raw data and build your own widget, web app, mobile app or desktop app then <a  href="http://kwwika.com/contact">please get in touch</a> too.</p>
<h2>Examples</h2>
<p>You can find a link to all the the live examples on <a  href="http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/example.html">Opta Sports &#8211; Cricket Match &amp; Events Centre demo</a> page.</p>
<p>The above examples are hard-coded to show the Ashes 2nd Test but here are the Scorecard widget links to allow you to view the data from the 3rd and 4th tests:</p>
<ul>
<li>3rd Test: <a  href="http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/single-scorecard.html?game_dir=/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101216/3RD_TEST">http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/single-scorecard.html?game_dir=/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101216/3RD_TEST</a></li>
<li>4th Test: <<a  href="http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/single-scorecard.html?game_dir=/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101226/4TH_TEST">/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20101226/4TH_TEST</a></li>
<li>5th Test: <a  href="http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/single-scorecard.html?game_dir=/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20110103/5TH_TEST">http://kwwika.com/Standalone/Demos/opta/cricket/ashes-widget/single-scorecard.html?game_dir=/OPTA/CRICKET/FIXTURES/AUSTRALIA_V_ENGLAND_ASHES_2010-11/20110103/5TH_TEST</a></li>
</ul>
<p>From the format of the above links I&#8217;m sure you&#8217;ll be able to work out how to view the other examples with different games <img src='http://www.leggetter.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><em>Additional</em></strong>: You can also see the <strong>South Africa v India</strong> test using this topic:</p>
<p>/OPTA/CRICKET/FIXTURES/SOUTH_AFRICA_V_INDIA_TEST_SERIES_2010-11/20101216/1ST_TEST</p>
<h2>Thanks</h2>
<p>Last but certainly not least, a bit thanks to everybody we worked with on this.</p>
<h3>Opta Sports</h3>
<p>A big thanks to <a  href="http://optasports.com/">Opta Sports</a> for working on this product with us and giving us a chance to show off our technology. Working with <a  href="http://twitter.com/#!/alonzehavi">Alon</a> in particular has been a pleasure.</p>
<h3>Matador Digital</h3>
<p>We&#8217;d also like to thank <a  href="http://www.matadorgroup.co.uk/">Matador Digital</a> for the UI work and doing the majority of the widget functionality (I couldn&#8217;t help &#8220;lending a hand&#8221; though). Dave did a great job helping us come up with the UI and Aaron never ceases to amaze me with little pieces of information that make daunting tasks seem so simple. Really appreciate your hard work guys!</p>
<p><a  href="http://blog.kwwika.com/kwwika-powered-real-time-opta-sports-cricket">Permalink</a></p>
<p>| <a  href="http://blog.kwwika.com/kwwika-powered-real-time-opta-sports-cricket#comment">Leave a comment  »</a></p>
<p><!-- digg verification --><br />
<span style="display:hidden">978d6a1bd7d647028d1d1f29d49cd10d</span></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2011/01/07/marriage-worklife-integration-real-time-web-technology-evangelism-kwwika-a-retrospective-of-my-2010.html' rel='bookmark' title='Marriage, Work/life integration, real-time web technology evangelism &amp; Kwwika: A retrospective of my 2010'>Marriage, Work/life integration, real-time web technology evangelism &#038; Kwwika: A retrospective of my 2010</a></li>
<li><a href='http://www.leggetter.co.uk/2011/08/04/adding-a-real-time-whos-shopping-widget-to-an-asp-net-web-app.html' rel='bookmark' title='Adding a real-time &quot;Who&#8217;s shopping?&quot; widget to an ASP.NET Web App'>Adding a real-time &quot;Who&#8217;s shopping?&quot; widget to an ASP.NET Web App</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kwwika support for webOS</title>
		<link>http://www.leggetter.co.uk/2010/12/07/kwwika-support-for-webos.html</link>
		<comments>http://www.leggetter.co.uk/2010/12/07/kwwika-support-for-webos.html#comments</comments>
		<pubDate>Tue, 07 Dec 2010 16:50:57 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Kwwika]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[webOS]]></category>

		<guid isPermaLink="false">http://blog.kwwika.com/kwwika-support-for-webos</guid>
		<description><![CDATA[        
	We&#039;ve got a potential client interested in using Kwwika on HP webOS so we&#039;ve been working with them to test the Kwwika JavaScript library on a platform that we&#039;ve not been directly targeting. After a problem glitch with the 64bi...
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
<li><a href='http://www.leggetter.co.uk/2010/08/13/plotting-tweets-in-real-time-using-smoothie-charts-and-kwwika.html' rel='bookmark' title='Plotting tweets in real-time using Smoothie Charts and Kwwika'>Plotting tweets in real-time using Smoothie Charts and Kwwika</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve got a potential client interested in using Kwwika on HP webOS so we&#8217;ve been <strong>working with them</strong> to test the Kwwika JavaScript library on a platform that we&#8217;ve not been directly targeting. After a problem glitch with the 64bit <a  href="http://developer.palm.com/index.php?option=com_content&#038;view=article&#038;layout=page&#038;id=1788&#038;Itemid=21">webOS SDK</a> (mainly JVM and PATH problems) we got the 32bit one up and running and the a webOS emulator fired up. From there Palm have created a really nifty web IDE called <a  href="http://ares.palm.com/Ares/about.html">Ares</a>. Ares communicates with the webOS emulator, which runs on <a  href="http://www.virtualbox.org/">Virtual Box</a>, via the web browser Java plugin and it allows you to launch the application and debug it. This works surprisingly well.</p>
<div>We came across three <a  href="http://leggetter.posterous.com/uncaught-typeerror-cannot-read-property-1-of">problems</a> with the Kwwika JavaScript API where we&#8217;d made assumptions that the library would be running within a web browser. We fixed this by stepping through the code with Ares debugger and soon we were connected, logged in, subscribing to data and publishing data.</p>
<p>The code is super-simple since it&#8217;s just a normal HTML page:</p>
<script src="http://gist.github.com/732019.js"></script>
<p><a  href="https://gist.github.com/732019"></a>And our application didn&#8217;t have any UI but you can see from the log at the bottom of this screenshot that the Kwwika JavaScript library is working with webOS as expected.</p>
<p><a href="http://www.leggetter.co.uk/wp-content/uploads/2010/12/webOS_Ares.png"><img class="aligncenter size-medium wp-image-3583" title="webOS Ares - using Kwwika" src="http://www.leggetter.co.uk/wp-content/uploads/2010/12/webOS_Ares-300x199.png" alt="webOS Ares - using Kwwika" width="300" height="199" /></a></p>
<p><a  href="http://blog.kwwika.com/kwwika-support-for-webos">Permalink</a></p>
<p>| <a  href="http://blog.kwwika.com/kwwika-support-for-webos#comment">Leave a comment  »</a></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
<li><a href='http://www.leggetter.co.uk/2010/08/13/plotting-tweets-in-real-time-using-smoothie-charts-and-kwwika.html' rel='bookmark' title='Plotting tweets in real-time using Smoothie Charts and Kwwika'>Plotting tweets in real-time using Smoothie Charts and Kwwika</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/12/07/kwwika-support-for-webos.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Push Services Open Up Real-Time to Everyone</title>
		<link>http://www.leggetter.co.uk/2010/09/14/client-push-services-open-up-real-time-to-everyone.html</link>
		<comments>http://www.leggetter.co.uk/2010/09/14/client-push-services-open-up-real-time-to-everyone.html#comments</comments>
		<pubDate>Tue, 14 Sep 2010 04:00:58 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[real-time client push]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[SaaS]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://blog.programmableweb.com/?p=15331</guid>
		<description><![CDATA[<a href="http://www.flickr.com/photos/blakespot/4011035061/"><img src="http://blog.programmableweb.com/wp-content/stopwatch.jpg" alt="Real-time" width="100" height="75" class="imgRight" /></a>The number of services offering <a href="http://www.programmableweb.com/apitag/?q=realtime">real-time APIs</a> is slowly but surely expanding and it looks like we're going to have to add quite a few more. Since the start of the year a new type of service has started to appear--client push services, which help developers include real-time updates in their web apps.
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/12/31/yahoo%e2%80%99s-open-sourced-s4-could-be-a-real-time-cloud-platform.html' rel='bookmark' title='Yahoo’s Open Sourced S4 Could be a Real-time Cloud Platform'>Yahoo’s Open Sourced S4 Could be a Real-time Cloud Platform</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/21/why-client-apis-are-an-important-part-of-any-real-time-service.html' rel='bookmark' title='Why client APIs are an important part of any real-time service'>Why client APIs are an important part of any real-time service</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.flickr.com/photos/blakespot/4011035061/"><img src="http://blog.programmableweb.com/wp-content/stopwatch.jpg" alt="Real-time" title="Real-time" width="100" height="75" class="imgRight" /></a>The number of services offering <a  href="http://www.programmableweb.com/apitag/?q=realtime">real-time APIs</a> is slowly but surely expanding and it looks like we&#8217;re going to have to add quite a few more. Since the start of the year a new type of service has started to appear&#8211;client push services, which help developers include real-time updates in their web apps.</p>
<p>Real-time client push APIs have actually been around for quite a while (around 10 years) as they are shipped with <a  href="http://en.wikipedia.org/wiki/Comet_(programming)">Comet servers</a> but only recently have these been moved into the cloud and offered as a service. The service flavour of these APIs give the developer the ability to instantly push information from their web server, through their chosen push service and into a web browser viewing their website.</p>
<p><img src="http://blog.programmableweb.com/wp-content/scrabbly.jpg" alt="Scrabb.ly -- real-time multi-player word game" title="Scrabb.ly -- real-time multi-player word game" width="578" height="342" class="aligncenter size-full wp-image-15374" /></p>
<p>Real-time client push is intended to replace the previous pull, or polling, mechanism that has been used for many years to mimic live data on a website. Using push via a dedicated Comet server is generally more resource efficient than polling a web server, and by using a service the resource load and complexity involved in setting up and running a Comet service is completely taken away from the developer&#8217;s considerations. This means that the web server is under much less strain, the developer can concentrate on building a killer real-time application and the website user gets the benefit of a truly real-time experience.</p>
<p>These services have only recently started to pop up due to a number of technology advancements. To be able to use a real-time client push service the web browser needs to be able to maintain a persistent connection back to the web server so that the web server can push information to it as soon as it becomes available. This has been achievable for a number of years via what some developer have labelled as &#8220;hacks&#8221; but is now easier than it has ever been. Most of the new services use the JavaScript <a  href="http://en.wikipedia.org/wiki/WebSockets">WebSocket</a> object to achieve this and fallback to using Flash if WebSockets are not supported by the browser.</p>
<p>The web browser also needs to be able to maintain a <em>cross domain</em> connection from the JavaScript code running in the website to the service e.g. a connection from blog.programmableweb.com to www.example.com. In older browsers cross domain connections were not allowed but the introduction of client access policy files (<a  href="http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">crossdomain.xml</a> and <a  href="http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspx">clientaccesspolicy.xml</a>) and more recently the <a  href="http://www.w3.org/TR/2008/WD-access-control-20080912/#access-control-allow-origin">Access-Control-Allow-Origin</a> HTTP header have made cross domain calls from JavaScript possible (You can find more information and a demo of this in action <a  href="http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html">here</a>).</p>
<p>All of the real-time client push services have adopted a data <a  href="http://en.wikipedia.org/wiki/Publish/subscribe">publisher subscriber model</a> with the web server code generally acting as the data publisher and the JavaScript code running in the web browser acting as the data subscriber. Subscriptions are made to a channel (or topic), that either exists or will be created, within the service and are identified by a name e.g. &#8220;my_channel&#8221; or &#8220;/PW/CHAT&#8221;. The publishers then simply publish data to that channel or topic using a service API and the information is instantly received by all subscribers, again via an API.</p>
<p>The real-time client push services that we know of at the moment are:</p>
<ul>
<li><a  href="http://beaconpush.com/">Beacon</a></li>
<li><a  href="http://hookbox.org/">Hookbox</a></li>
<li><a  href="http://kwwika.com/">Kwwika</a> (disclosure: author is a founder)</li>
<li><a  href="http://www.pubnub.com/">PubNub</a></li>
<li><a  href="http://pusherapp.com/">Pusher</a></li>
<li><a  href="http://www.frozenmountain.com/websync/">WebSync</a></li>
</ul>
<p>And some examples of their use include:</p>
<ul>
<li><a  href="http://blog.programmableweb.com/2010/08/26/real-time-news-reader-shows-off-push-to-browser/">A real-time news reader</a></li>
<li><a  href="http://www.pubnub.com/blog/facebook-meh-button">A Facebook &#8220;meh&#8221; button</a></li>
<li><a  href="http://www.startupmonkeys.com/2010/09/building-a-scrabble-mmo-in-48-hours/">Interactive games</a></li>
<li><a  href="http://kwwika.com/Standalone/Demos/ReplayWorldCup2010/">Real-time sports statistics</a> (requires HTML5 support)</li>
</ul>
<p>You can also check out the demos on each of the services websites.</p>
<p><img src="http://blog.programmableweb.com/wp-content/meh-button.jpg" alt="The real-time &#039;meh&#039; button" title="The real-time &#039;meh&#039; button" width="457" height="136" class="aligncenter size-full wp-image-15373" /></p>
<p>Real-time is already a big topic and users are starting to demand data and results as fast as possible. There is also the expectation that they should be informed as soon as new data is available or the existing data changes. Google are already pressing ahead with new real-time advancements such as <a  href="http://www.google.com/realtime">Google Real-Time search</a> (which actually <a  href="http://www.leggetter.co.uk/2010/08/27/google-realtime-search-isnt-real-time.html">uses polling</a>) and <a  href="http://www.google.com/instant/">Google Instant</a> but the good news is that with the availability of real-time client push services any developer can now add real-time to their website.</p>
<p>Let us know if you are interested in finding out more about these real-time client push APIs and services and we&#8217;ll cover each one in more detail.</p>
<p>Photo via <a  href="http://www.blakespot.com/">Blake Patterson</a></p>
<p><a  href="http://blog.programmableweb.com/2010/09/14/client-push-services-open-up-real-time-to-everyone/">Originally posted on Programmable Web</a></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/12/31/yahoo%e2%80%99s-open-sourced-s4-could-be-a-real-time-cloud-platform.html' rel='bookmark' title='Yahoo’s Open Sourced S4 Could be a Real-time Cloud Platform'>Yahoo’s Open Sourced S4 Could be a Real-time Cloud Platform</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/21/why-client-apis-are-an-important-part-of-any-real-time-service.html' rel='bookmark' title='Why client APIs are an important part of any real-time service'>Why client APIs are an important part of any real-time service</a></li>
<li><a href='http://www.leggetter.co.uk/2012/01/24/hosted-realtime-services-making-the-realtime-web-more-accessible.html' rel='bookmark' title='Hosted realtime services &#8211; making the realtime web more accessible'>Hosted realtime services &#8211; making the realtime web more accessible</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/09/14/client-push-services-open-up-real-time-to-everyone.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geo Grandfather ESRI Makes Strides on the Web</title>
		<link>http://www.leggetter.co.uk/2010/08/23/geo-grandfather-esri-makes-strides-on-the-web.html</link>
		<comments>http://www.leggetter.co.uk/2010/08/23/geo-grandfather-esri-makes-strides-on-the-web.html#comments</comments>
		<pubDate>Mon, 23 Aug 2010 12:30:09 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://blog.programmableweb.com/?p=14267</guid>
		<description><![CDATA[<a href="http://www.programmableweb.com/api/esri-arcgis-javascript"><img src="http://www.programmableweb.com/images/apis/at869.png" alt="ESRI ArcGIS JavaScript" class="imgRight" /></a>Most of the time we write about mapping, it admittedly includes Google Maps (we list over <a href="http://www.programmableweb.com/api/google-maps/mashups">2000 Google Maps mashups</a>). However, <a href="http://esri.com/">ESRI</a>, the biggest supplier of geographic tools for the enterprise, has made huge strides this year with its tools, including its own web mapping platform, <a href="http://www.programmableweb.com/api/esri-arcgis-javascript">ESRI ArcGIS JavaScript API</a>.
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.programmableweb.com/api/esri-arcgis-javascript"><img src="http://www.programmableweb.com/images/apis/at869.png" alt="ESRI ArcGIS JavaScript" class="imgRight" /></a>Most of the time we write about mapping, it admittedly includes Google Maps (we list over <a  href="http://www.programmableweb.com/api/google-maps/mashups">2000 Google Maps mashups</a>). However, <a  href="http://esri.com/">ESRI</a>, the biggest supplier of geographic tools for the enterprise, has made huge strides this year with its tools, including its own web mapping platform, <a  href="http://www.programmableweb.com/api/esri-arcgis-javascript">ESRI ArcGIS JavaScript API</a>.</p>
<p>Earlier this year ESRI <a  href="http://www.esri.com/news/releases/10_2qtr/arcgis10-download.html">released ArcGIS Server 10</a> and in the the past few months a stream of associated updates and new releases have been announced including version 2.0 of their <a  href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2010/06/29/ArcGIS-APIs-for-JavaScript-and-Flex_3A00_-Version-2.0-now-final_2100_.aspx">JavaScript, Flex</a> and <a  href="http://blogs.esri.com/Dev/blogs/silverlightwpf/">Silverlight/WPF</a> APIs. ESRI has also <a  href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2010/08/02/Build-applications-for-iOS-using-the-ArcGIS-API-for-Javascript.aspx">announced the release</a> of a compact ArcGIS for JavaScript version designed for building applications where slower Internet speeds and network latency is an issue, such as mobile phones. They also plan to release a native iPhone API (ArcGIS API for iOS), which is slated for the third quarter of 2010, and an ArcGIS for Windows Phone API down for mid-August as part of version 2.1 API releases.</p>
<p style="text-align: center; margin-top: 10px;">
<a  href="http://www.programmableweb.com/api/esri-arcgis-javascript"><img src="http://blog.programmableweb.com/wp-content/arcgis-ios1-158x300.jpg" alt="ArcGIS for iOS" title="ArcGIS for iOS" width="158" height="300"/></a>
</p>
<p>&#8220;It&#8217;s exciting to hear news of ArcGIS Server instances in the cloud, coupled with the new mappings APIs,&#8221; <a  href="http://gisconsultancy.com/blog/about">Rob Dunfey</a>, who has previously worked at ESRI and now works at Shell, said of the new tools. &#8220;We can start to deliver easy to use apps which answer business problems with a geo component. For example, the iPhone app for the CEO which downloads local sales stats as they move from site to site.&#8221;</p>
<p>The version 2.0 API release adds new functionality and exposes a number of new features available in ArcGIS Server 10:</p>
<ul>
<li>A features service which expose access to vector feature geometries and attributes.</li>
<li>Geometry service updates to facilitate Web editing.</li>
<li>Time aware layers to allow you to query or display time-aware layers using a particular slice of time.</li>
<li>Network analysis.</li>
<li>Bing Maps support updates.</li>
<li>Geocoding updates.</li>
<li>Mapping enhancements.</li>
<li>Built-in support for touch gestures in the JavaScript API.</li>
</ul>
<p>For a full list of features see the What&#8217;s New sections of the guides for <a  href="http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//00930000000m000000.htm">ArcGIS Server 10</a>, <a  href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/new_v20.htm">ArcGIS for JavaScript</a>, <a  href="http://help.arcgis.com/en/webapi/flex/help/index.html#whats_new.htm%20">ArcGIS API for Flex</a> and <a  href="http://help.arcgis.com/en/webapi/silverlight/help/?Whats_new.htm">ArcGIS API for Microsoft Silverlight / WPF</a>.</p>
<p>The ESRI mapping APIs, which are <a  href="http://blog.programmableweb.com/2009/07/31/is-free-enough-for-esri-to-gain-web-mapping-traction/">freely available</a>, differentiate themselves from the <a  href="http://www.programmableweb.com/apitag/mapping">plethora of consumer focused mapping APIs</a> out there in their depth of GIS analysis they support, their ability to ask complex questions of spatial proximity and topology. However, to access this extra functionality on your own data you need to buy a license.</p>
<p>The implications of all these APIs means that the accessibility to commercial-grade GIS technology is much greater and as developers become more familiar with GIS they could potentially start bidding for development projects that were previously only accessible to GIS development houses. It also means that platforms and devices that were previously only used by consumers can potentially be used in the field.</p>
<p>With platforms such as the Web (JavaScript, Silverlight and Flex), desktop (WPF and Flex using Air) and mobile (JavaScript, Silverlight for Windows Phone and iOS) covered, and with an extra level of GIS functional, ESRI appears to have everything in place to continue being the go-to company for GIS map-based application development.</p>
<p>This post was <a  href="http://blog.programmableweb.com/2010/08/23/geo-grandfather-esri-makes-strides-on-the-web/">originally on Programmable Web</a>.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/08/23/geo-grandfather-esri-makes-strides-on-the-web.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plotting tweets in real-time using Smoothie Charts and Kwwika</title>
		<link>http://www.leggetter.co.uk/2010/08/13/plotting-tweets-in-real-time-using-smoothie-charts-and-kwwika.html</link>
		<comments>http://www.leggetter.co.uk/2010/08/13/plotting-tweets-in-real-time-using-smoothie-charts-and-kwwika.html#comments</comments>
		<pubDate>Fri, 13 Aug 2010 00:35:00 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[Smoothie]]></category>

		<guid isPermaLink="false">http://blog.kwwika.com/plotting-tweets-in-real-time-using-smoothie-c</guid>
		<description><![CDATA[        
	I noticed a tweet today about real-time JavaScript charts and couldn't resist having a play. The charts are call Smoothie Charts and have been developed by Joe Walnes. You can read the blog post where he announced the release of them here.

...
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/08/10/kwwika-superfeedr-real-time-demo-available-2.html' rel='bookmark' title='Kwwika-Superfeedr real-time demo available'>Kwwika-Superfeedr real-time demo available</a></li>
<li><a href='http://www.leggetter.co.uk/2010/06/11/kwwika-world-cup-2010-real-time-push-web-app-apple-ipad-competition.html' rel='bookmark' title='Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition'>Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I noticed a tweet today about real-time JavaScript charts and couldn&#8217;t resist having a play. The charts are call <a  href="http://smoothiecharts.org/">Smoothie Charts</a> and have been developed by <a  href="http://joewalnes.com/">Joe Walnes</a>. You can read the blog post where he announced the release of them <a  href="http://joewalnes.com/2010/08/10/introducing-smoothie-charts/">here</a>.</p>
<p>The demos that I&#8217;ve seen don&#8217;t use real-time data so I thought I would create a small demo using real-time tweets being pushed through Kwwika. I updated the Kwwika TweetStreamer component (which I must get around to putting in GitHub) to push through updates from some popular hashtags including #nowplaying, #news, #tech and a few others and then wrote a bit of code to count the number of tweet updates over an interval and push that value into a Smoothie chart. The result looks like this (Smoothie charts use Canvas so only work in some browsers. I&#8217;ve tested this demo in Firefox and Chrome):</p>
<p><a  href="http://posterous.com/getfile/files.posterous.com/kwwika/XGJM92hzwVJon8G7UYu9VoIu8Ncy5AoVYCQyMPtxFEBOL7wNI0ZgzxFjoRe6/smoothie-charts-kwwika-demo.png.scaled.1000.jpg" class="thickbox no_icon" rel="gallery-1324"><img src="http://posterous.com/getfile/files.posterous.com/kwwika/PaXOMHgzq7ZlJRSoWUekNYeXTrBMOcrMokg1wVHAwhV2ABdjYPtNgJSWqHGe/smoothie-charts-kwwika-demo.png.scaled.500.jpg" width="500" height="310"/></a></p>
<p>You can see the <a  href="http://kwwika.com/Standalone/Demos/javascript-examples/smoothie-twitter-charting/">Smoothie Twitter Real-Time Charting demo using Kwwika</a> here:&nbsp;<a  href="http://kwwika.com/Standalone/Demos/javascript-examples/smoothie-twitter-charting/">http://kwwika.com/Standalone/Demos/javascript-examples/smoothie-twitter-charting/</a></p>
<p>I&#8217;ve got the Smoothie chart showing the number of updates for each twitter hashtag, a table showing the count and a list of the tweets at the bottom.</p>
<p>The <a  href="http://github.com/kwwika/javascript-examples/tree/master/smoothie-twitter-charting/">code is in GitHub</a> so feel free to fork/download and have a play yourself. You can run the code on <strong>http://localhost</strong> but in order to get the code to work on your own website you&#8217;ll need to register with Kwwika and get in touch to let us know you want access to the real-time Twitter hashtag topics.</p>
<p><strong>Update</strong>: We found a bug in the Smoothie library which&nbsp;<a  href="http://joewalnes.com/">Joe Walnes</a>&nbsp;promptly fixed.</p>
<p><span style="text-decoration: line-through;">One thing we&#8217;ve noticed is that the Smoothie chart stops working and throws an exception and as yet we&#8217;ve not been able to work out what the problem is due to lack of time. It&#8217;s probably something to do with not getting any updated values in a TimeSeries. This is what the exception look like in Firebug:</span></p>
<p><span style="text-decoration: line-through;"><a  href="http://posterous.com/getfile/files.posterous.com/kwwika/Vp23p7cm97EFrfOilESyaIbwqzm7309thB9Qqs0HPIlHiltIiy6mQsUKd2G7/smoothie-error.png" class="thickbox no_icon" rel="gallery-1324"><img src="http://posterous.com/getfile/files.posterous.com/kwwika/aqZ5qseaLq9M5W2QYP0vXoB3VcFpmZY4pTfQZ0e3CFp3VNffBo6thTOLQL1u/smoothie-error.png.scaled.500.jpg" width="500" height="54"/></a><br />
</span></p>
<p><span style="text-decoration: line-through;">If anybody can work out what the problem is please let us know. Failing that we&#8217;ll look into it when we can.</span></p>
<p><a  href="http://blog.kwwika.com/plotting-tweets-in-real-time-using-smoothie-c">Permalink</a> </p>
<p>	| <a  href="http://blog.kwwika.com/plotting-tweets-in-real-time-using-smoothie-c#comment">Leave a comment&nbsp;&nbsp;&raquo;</a></p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/08/10/kwwika-superfeedr-real-time-demo-available-2.html' rel='bookmark' title='Kwwika-Superfeedr real-time demo available'>Kwwika-Superfeedr real-time demo available</a></li>
<li><a href='http://www.leggetter.co.uk/2010/06/11/kwwika-world-cup-2010-real-time-push-web-app-apple-ipad-competition.html' rel='bookmark' title='Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition'>Kwwika World Cup 2010 Real-Time Push Web App &#8211; Apple iPad competition</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/08/13/plotting-tweets-in-real-time-using-smoothie-charts-and-kwwika.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://posterous.com/getfile/files.posterous.com/kwwika/Vp23p7cm97EFrfOilESyaIbwqzm7309thB9Qqs0HPIlHiltIiy6mQsUKd2G7/smoothie-error.png" length="" type="image/png" />
		</item>
		<item>
		<title>Kwwika Silverlight API &#8211; Chat Example</title>
		<link>http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html</link>
		<comments>http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html#comments</comments>
		<pubDate>Mon, 10 May 2010 17:30:49 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Kwwika]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html</guid>
		<description><![CDATA[<p> This video shows a chat application built using the Kwwika JavaScript API and a chat application built using the Kwwika Silverlight API. Both applications can communicate with each other in real-time using the Kwwika service. <p /> We&#39;ll release the source code for both applications in the very near future. <p /> <p>Related posts: [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>    This video shows a chat application built using the Kwwika JavaScript API and a chat application built using the Kwwika Silverlight API. Both applications can communicate with each other in real-time using the Kwwika service.
<p />
<div>We&#39;ll release the source code for both applications in the very near future.</div>
<p />
<div><object height="300" width="500"><param name="movie" value="http://www.youtube.com/v/bmkR0tO7WhA&#038;hl=en&#038;fs=1&#038;hd=1" /></param><param name="wmode" value="window" /><param name="allowFullScreen" value="true" /></param><param name="allowscriptaccess" value="always" /></param><embed src="http://www.youtube.com/v/bmkR0tO7WhA&#038;hl=en&#038;fs=1&#038;hd=1" allowfullscreen="true" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="window" height="300" width="500"></embed></object></div>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html' rel='bookmark' title='Defining the Kwwika API'>Defining the Kwwika API</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Defining the Kwwika API</title>
		<link>http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html</link>
		<comments>http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html#comments</comments>
		<pubDate>Fri, 02 Apr 2010 11:34:48 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Real-Time Web Musings]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Kwwika]]></category>
		<category><![CDATA[real-time data]]></category>
		<category><![CDATA[real-time web]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=773</guid>
		<description><![CDATA[<p>Update: Hang on a minute. You&#8217;ve not explained what Kwwika is!<br /> In a really <a href="http://nur.ph/ih7pgw">informative chat using Nurph</a>, which has been really useful in getting feedback, it was pointed out to me by <a href="http://nur.ph/users/rythie">@rythie</a> and <a href="http://nur.ph/users/neilcauldwell">@NeilCauldwell</a> that I need to explain what problem Kwwika is trying to solve before asking what [...]
Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html' rel='bookmark' title='Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest'>Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest</a></li>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Update: Hang on a minute. You&#8217;ve not explained what <em>Kwwika</em> is!</strong><br />
In a really <a  href="http://nur.ph/ih7pgw">informative chat using Nurph</a>, which has been really useful in getting feedback, it was pointed out to me by <a  href="http://nur.ph/users/rythie">@rythie</a> and <a  href="http://nur.ph/users/neilcauldwell">@NeilCauldwell</a> that I need to explain what problem Kwwika is trying to solve before asking what the API should look like.</p>
<h2>Why do we need Kwwika?</h2>
<p>There are loads of real-time technologies available at the moment. Almost all of them have a reasonable learning curve and require a developer to sort out server infrastructure, perform installation, do all sort of configuration and then finally get around to writing an application. In the same way that a lot of developers or organisations have moved into managed hosting for their websites, or more recently moved a lot of their IT infrastructure into the Cloud, Kwwika offers a managed and scalable real-time infrastructure so you can concentrate on building your <a  href="http://www.leggetter.co.uk/2009/10/29/real-time-rich-internet-applications-rtria.html">Real-Time Rich Internet Application</a>.</p>
<p>The way I&#8217;m describing Kwwika at the moment is:</p>
<blockquote><p>Kwwika is a real-time web data sharing platform with APIs in JavaScript, Silveright, .NET, Java and C.</p></blockquote>
<h3>An example of where Kwwika could be used</h3>
<p><a  href="http://blog.caplin.com/author/martintcaplincom/">Martin Tyler</a> recently wrote a <a  href="http://blog.caplin.com/2010/02/24/when-were-you-when-tendulkar-scored-200/">blog post</a> that provides a great example of where a service like Kwwika would have been really useful. In the situation described in the blog post <a  href="http://www.cricinfo.com/">CricInfo</a> could simply publish their cricket updates to their defined topic in Kwwika, maybe <em>/CRICINFO/GAMES/INDIA-SOUTHAFRICA/</em>, from a single server. They would then add a small piece of script to their game web page that subscribes to this topic and updates that web page whenever any new data is available. Users would see the real-time in-page updates and would no longer continue to hit &#8220;Refresh&#8221; to see if the score had updated. Kwwika would instead take the hit of the data transfer and push the live updates to the web page. This would take a massive load off of the CricInfo server and clearly save them a lot of time and infrastructure costs.</p>
<h2>How will I use Kwwika?</h2>
<p>When we launch Kwwika all you&#8217;ll need to do to use the service is:</p>
<ol>
<li>Register for Kwwika via a sign up page</li>
<li>Define your topics that you would like to publish data to in the Kwwika dashboard e.g. <em>/PhilLeggetter/Kwwika</em></li>
<li>Find some topics with information on that you are interested in using e.g. <em>/BBC/NEWS/SPORT/FOOTBALL</em> (doesn&#8217;t exist &#8211; just an example &#8211; but how cool would that be!)</li>
<li>Embed the Kwwika &lt;script&gt; tag in your web application or download the API for your chosen technology</li>
<li>Start developing your Real-Time Rich Internet Application</li>
</ol>
<ul></ul>
<p>I think the great thing about this is that developers just use the Kwwika service and only ever need to care about developing their own application. Kwwika provides the server infrastructure so you don&#8217;t have to.</p>
<h2>The Kwwika API</h2>
<p>I&#8217;m in the middle of defining the Kwwika API and thought this would be a great opportunity to get some early feedback. We plan to have initial releases of the API for the following technologies:</p>
<ul>
<li>JavaScript</li>
<li>Java</li>
<li>.NET</li>
<li>Silverlight</li>
<li>C</li>
</ul>
<p>The API is really simple. It has the following functionality:</p>
<ul>
<li>Connect</li>
<li>Receive connection events</li>
<li>Subscribe for data</li>
<li>Receive subscription events such as errors and data updates</li>
<li>Publish data</li>
<li>Receive data publishing events (publish success or failure)</li>
<li>Disconnect</li>
</ul>
<p>At the moment we have two ways of thinking about the API. The following two examples are using the JavaScript API but we plan to make the APIs virtually identical between technologies with the only differences down to following the language specific standards.<br />
<span id="more-773"></span><br />
Our main topic of discussion is around how you initiate your connection to the Kwwika service but for completeness I&#8217;ll provide full examples. The first option we have is to create a <code>Connection</code> object using a factory method on the <code>kwwika</code> namespace.</p>
<pre class="brush: jscript; title: ; notranslate">
var oConnection = kwwika.connect({
									&quot;connectionStatusUpdated&quot;:function(sStatus)
									{
										document.getElementById(&quot;connectionStatus&quot;).innerHTML = sStatus;
									}
								 });

var oSubscription =
	oConnection.subscribe(&quot;/KWWIKA/LIBRARIES/JavaScriptAPI&quot;,
						  {
						  	&quot;topicUpdated&quot;:function(oSubscription, mUpdate)
						  	{
						  		for(var sFieldName in mUpdate)
						  		{
						  			document.getElementById(&quot;field_&quot; + sFieldName).innerHTML = mUpdate[sFieldName];
						  		}
						  	},
						  	&quot;topicError&quot;:function(oSubscription, sReason)
						  	{
						  		var sMsg = oSubscription.topicName + &quot; error: &quot; + sReason;
						  		document.getElementById(&quot;topicErrorMessage&quot;).innerHTML = sMsg;
						  	});

oConnection.publish(&quot;/KWWIKA/LIBRARIES/JavaScriptAPI&quot;,
					{
						&quot;name&quot;: &quot;Phil Leggetter&quot;,
						&quot;status&quot;: &quot;Getting feedback about the Kwwika API&quot;,
						&quot;datetime&quot;: new Date().getTime()
					},
					{
						&quot;commandSuccess&quot;:function(oSubscription)
						{
							var sMsg = oSubscription.topicName + &quot; message published.&quot;;
						  	document.getElementById(&quot;publishStatus&quot;).innerHTML = sMsg;
						},
						&quot;commandError&quot;:function(oSubscription, sError)
						{
							var sMsg = oSubscription.topicName + &quot; publish error: &quot; + sError;
						  	document.getElementById(&quot;publishStatus&quot;).innerHTML = sMsg;
						}
					});
</pre>
<p>In the second option is to create a new <code>Kwwika</code> object.</p>
<pre class="brush: jscript; title: ; notranslate">
var oKwwika = new Kwwika({
							&quot;connectionStatusUpdated&quot;:function(sStatus)
							{
								document.getElementById(&quot;connectionStatus&quot;).innerHTML = sStatus;
							}
						 });

var oSubscription =
	oKwwika.subscribe(&quot;/KWWIKA/LIBRARIES/JavaScriptAPI&quot;,
					  {
					  	&quot;topicUpdated&quot;:function(oSubscription, mUpdate)
					  	{
					  		for(var sFieldName in mUpdate)
					  		{
					  			document.getElementById(&quot;field_&quot; + sFieldName).innerHTML = mUpdate[sFieldName];
					  		}
					  	},
					  	&quot;topicError&quot;:function(oSubscription, sReason)
					  	{
					  		var sMsg = oSubscription.topicName + &quot; error: &quot; + sReason;
					  		document.getElementById(&quot;topicErrorMessage&quot;).innerHTML = sMsg;
					  	});

oKwwika.publish(&quot;/KWWIKA/LIBRARIES/JavaScriptAPI&quot;,
				{
					&quot;name&quot;: &quot;Phil Leggetter&quot;,
					&quot;status&quot;: &quot;Getting feedback about the Kwwika API&quot;,
					&quot;datetime&quot;: new Date().getTime()
				},
				{
					&quot;commandSuccess&quot;:function(oSubscription)
					{
						var sMsg = oSubscription.topicName + &quot; message published.&quot;;
					  	document.getElementById(&quot;publishStatus&quot;).innerHTML = sMsg;
					},
					&quot;commandError&quot;:function(oSubscription, sError)
					{
						var sMsg = oSubscription.topicName + &quot; publish error: &quot; + sError;
					  	document.getElementById(&quot;publishStatus&quot;).innerHTML = sMsg;
					}
				});
</pre>
<p>Do the above examples make sense? Is the API easy enough to use? How would you establish a connection to the Kwwika service? Would you do anything differently?</p>
<p>I&#8217;d love to get you feedback so please leave your comments below or email me directly using <a href="mailto:phil@leggetter.co.uk?subject=Defining the Kwwika API">phil@leggetter.co.uk</a>.</p>
<p>Related posts:<ol>
<li><a href='http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html' rel='bookmark' title='Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest'>Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest</a></li>
<li><a href='http://www.leggetter.co.uk/2010/05/10/kwwika-silverlight-api-chat-example-2.html' rel='bookmark' title='Kwwika Silverlight API &#8211; Chat Example'>Kwwika Silverlight API &#8211; Chat Example</a></li>
<li><a href='http://www.leggetter.co.uk/2010/12/17/kwwika-powered-real-time-opta-sports-cricket-widget.html' rel='bookmark' title='Kwwika Powered Real-Time Opta Sports Cricket Widget'>Kwwika Powered Real-Time Opta Sports Cricket Widget</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/04/02/defining-the-kwwika-api.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 25/107 queries in 0.080 seconds using disk: basic

Served from: www.leggetter.co.uk @ 2012-02-04 20:35:56 -->
