<?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>Sameer Ahuja &#187; Play</title>
	<atom:link href="http://sameerahuja.com/blog/tags/play/feed/" rel="self" type="application/rss+xml" />
	<link>http://sameerahuja.com</link>
	<description></description>
	<lastBuildDate>Wed, 09 Jun 2010 21:34:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Experiments with publishing application activity</title>
		<link>http://sameerahuja.com/blog/experiments-with-publishing-application-activity/</link>
		<comments>http://sameerahuja.com/blog/experiments-with-publishing-application-activity/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 15:29:57 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Play]]></category>

		<guid isPermaLink="false">http://sameerahuja.com/2008/02/experiments-with-publishing-activity/</guid>
		<description><![CDATA[For a couple of weeks now I&#8217;ve been monitoring what I do on my Mac using two tracker tools: Wakoopa and RescueTime. Both have unique approaches to the theme of tracking. Wakoopa builds a social network around the applications that you use. It lets you build &#8216;teams&#8217; of people and see what your friends have [...]]]></description>
			<content:encoded><![CDATA[<p>For a couple of weeks now I&#8217;ve been monitoring what I do on my Mac using two tracker tools: <a href="http://www.wakoopa.com">Wakoopa</a> and <a href="http://www.rescuetime.com">RescueTime</a>. Both have unique approaches to the theme of tracking. Wakoopa builds a social network around the applications that you use. It lets you build &#8216;teams&#8217; of people and see what your friends have been using. The other two significant things that it does are statistical visualizations, and recommendations of apps based on what you&#8217;ve been using. So if you&#8217;ve been using a lot of TextEdit lately, it might recommend TextMate as a &#8216;similar&#8217; application. This, according to my guesswork, they do by matching application tags.</p>

<p><img style="float: none;" src="http://sameer.dreamhosters.com/wp-content/uploads/2008/02/wakoopa-recommendations.jpg" alt="Wakoopa Recommendations" /></p>

<p>The other way to do these recommendations could be to match people based on their application sets (or better still, their activity sets. If app = Microsoft Word, then Activity = word processing); and then provide recommendations based on what other people who have similar appication/activity sets are using, that the current user isn&#8217;t.</p>

<p>Anyways, Wakoopa does provide a simple API to accessing its data, and that is a great thing to do. That&#8217;s something that RescueTime hasn&#8217;t done yet, but they promise to do the same soon on their site. RescueTime has a unique approach to this whole domain. They aren&#8217;t building a social network (at least till yet), and this is how they track your apps: If you are using a standard application, the RescueTime tracker records its usage as any other tracker. If, however, you are on a browser, the tracker records the website that you&#8217;re visiting as an &#8216;application&#8217;, which makes some sense in this era of online applications. You can then go to the website and assign &#8216;tags&#8217; to applications. These can later be visualized to see how much time, for example, you spend &#8216;Watching Videos Online&#8217;.</p>

<p><img style="float:none; margin: 3px 3px 3px 3px;" src="http://sameer.dreamhosters.com/wp-content/uploads/2008/02/rescue-time-dashboard.jpg" alt="Rescue Time Dashboard" /></p>

<p>So anyways, I&#8217;ve been itching to use the incredibly simple to use <a href="http://code.google.com/apis/chart/">GChart APIs</a> with an interesting enough data-set, and Wakoopa stats are sortof interesting (at least for me&#8230;), so last weekend I cooked up a script to make a pie chart of my recent application usage. Its available <a href="http://sameerahuja.com/playground/visualize-this/">here</a>, and at the point of writing this post, this is how my stats looked:</p>

<p><img style="border-width: 2px; float:none; margin: 3px 3px 3px 3px;" src="http://sameer.dreamhosters.com/wp-content/uploads/2008/02/application-use-chart.jpg" alt="Application usage chart" /></p>

<p>Which, I suppose, is a pretty reasonable graph. Half of what we do on our computers these days is more or less on the web (50% of which is on YouTube, which is, IMHO, the greatest time sink ever invented). Mail takes about 20%, and the actual work takes the rest. (Source after the jump)</p>

<p><span id="more-34"></span></p>

<p>The source code for the vis is pretty simple. All it does is load the XML API URL, parse through to generate a Google Chart compatible format, and call the image URL for Pie Charts:</p>

<p><pre class="brush: php;">
$request_url = &amp;quot;http://api.wakoopa.com/sameer/most_used.xml&amp;quot;;&lt;/p&gt;

&lt;p&gt;//App names
$names = &amp;quot;&amp;quot;;
//Usage values
$values = &amp;quot;&amp;quot;;
//For calculations
$total = 0;&lt;/p&gt;

&lt;p&gt;$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);&lt;/p&gt;

&lt;p&gt;$xml = new SimpleXMLElement($data);&lt;/p&gt;

&lt;p&gt;//Computing total
foreach($xml-&amp;gt;software as $sw){
   $total += intval($sw-&amp;gt;{'active-seconds'});
}
//Computing values in GChart-compatible format. Have a look at this: http://code.google.com/apis/chart/#pie_charts
foreach($xml-&amp;gt;software as $sw){
       $names = $names.&amp;quot;|&amp;quot;.$sw-&amp;gt;name;
       $values = $values.&amp;quot;,&amp;quot;.(round(intval($sw-&amp;gt;{'active-seconds'})*100/$total, 1));
    }&lt;/p&gt;

&lt;p&gt;//That's it! Load the image.
echo '&amp;lt;br&amp;gt;&amp;lt;img src=&amp;quot;http://chart.apis.google.com/chart?
cht=p&amp;amp;chco=3587DCFF,99E142FF,993C99FF,90A4E5FF,DAD52EFF,C95854FF,AE4496FF&amp;amp;
chd=t:'.trim($values, &amp;quot;,&amp;quot;).'&amp;amp;chs=450x300&amp;amp;chl='.trim($names,&amp;quot;|&amp;quot;).'&amp;quot;&amp;gt;';
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://sameerahuja.com/blog/experiments-with-publishing-application-activity/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
