<?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>aleatory &#187; Facebook</title>
	<atom:link href="http://aleatory.clientsideweb.net/category/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://aleatory.clientsideweb.net</link>
	<description></description>
	<lastBuildDate>Sat, 17 Jul 2010 00:32:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google &amp; It&#8217;s Search For a Social Graph</title>
		<link>http://aleatory.clientsideweb.net/2010/07/12/google-its-search-for-a-social-graph/</link>
		<comments>http://aleatory.clientsideweb.net/2010/07/12/google-its-search-for-a-social-graph/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 02:39:54 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=296</guid>
		<description><![CDATA[
image courtesy Tantek

Techcrunch lead on a $100m investment by Google in Zynga the social network gaming company.  It&#8217;s the latest in a long line of Google failures in a vital area of capturing web traffic &#8211; or, &#8220;organising the world&#8217;s information&#8221; as Google diplomatically puts it.

Canny move or desperation?

When examined in detail for such [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="Google Borg" src="http://farm1.static.flickr.com/100/266828935_c026cb1b84.jpg" title="Resistance is Futile" class="center" width="375" height="500" /><br />
<span class="attribution">image courtesy <a href="http://www.flickr.com/photos/tantek/266828935/">Tantek</a></span></p>
<p>
Techcrunch lead on a <a href="http://techcrunch.com/2010/07/10/google-secretly-invested-100-million-in-zynga-preparing-to-launch-google-games/">$100m investment by Google</a> in Zynga the social network gaming company.  It&#8217;s the latest in a <a href="http://aleatory.clientsideweb.net/2009/10/28/the-google-deadpool/">long line of Google failures</a> in a vital area of capturing web traffic &#8211; or, &#8220;organising the world&#8217;s information&#8221; as Google diplomatically puts it.</p>
<p>
Canny move or desperation?</p>
<p>
<span id="more-296"></span>When examined in detail for such a blazingly successful company as Google are their record in social really is shocking: a near-continuous stream of failure with little apparent success on the horizon anytime soon.  Something is playing up in non-evil algorithm land.</p>
<p>
Dead</p>
<ul>
<li>Dodgeball</li>
<li>lively</li>
<li>Jaiku</li>
</ul>
<p>
Not Dead</p>
<ul>
<li>Latitude</li>
<li>Wave</li>
<li>Buzz</li>
</ul>
<p>
All are relatively unsuccessful on either Google or their own niche terms.</p>
<p>
All elements of organising a user&#8217;s network around their infrastructure and not someone else.  Each one concentrating on a certain social metaphor and each one failing in their own anonymous way.  What will be different about gaming?  What will make users skip their existing social accounts and networks that already have these games?  While they tend to be pretty limited in depth what will Google do that will be different?</p>
<p>
Obviously I&#8217;m highly sceptical but when you look at the stakes it&#8217;s vital for Google that they find a social <em>something</em> that sticks.  Especially when the CEO has always <a href="http://www.google.co.uk/press/pressrel/advertising.html">seen them as a media company</a> first and foremost.</p>
<p>
Facebook with their über-targeted ads has a technology and reach that is arguably more powerful than Google&#8217;s.  It is a big threat to continued adwords growth, which despite all the moves against Microsoft &#038; Apple is surely Google&#8217;s #1 priority.  </p>
<p>
If gaming really is the leverage to unseat Facebook then Zynga may turn out to be a great choice &#8211; the 3 year old company is already rumoured to be projecting $1bn in revenue for 2011, signalling the undoubted importance of this much derided gaming sub-industry.</p>
<p>
It may be blood from a stone attempting to get Google to admit it&#8217;s worried about anything &#8211; least of all a single web site &#8211; But putting yourself in their shoes it&#8217;s difficult to see Facebook&#8217;s rise as anything less than the #1 threat to their existing revenue model.</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2010/07/12/google-its-search-for-a-social-graph/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SEO No Go</title>
		<link>http://aleatory.clientsideweb.net/2010/04/24/seo-no-go/</link>
		<comments>http://aleatory.clientsideweb.net/2010/04/24/seo-no-go/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 21:39:25 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=218</guid>
		<description><![CDATA[I get asked quite a bit if sites can use their facebook page to create inbound links to their homepage for Search Engine Optimisation purposes.
First off I point out that although FB Pages are public, Facebook adds rel=&#8221;nofollow&#8221; to all external links posted on users &#038; pages walls, meaning no benefit for seo.
However I have [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2010/04/facebook-seo.png" alt="facebook seo" title="facebook seo" width="176" height="100" class="alignleft size-full wp-image-217" />I get asked quite a bit if sites can use their facebook page to create inbound links to their homepage for Search Engine Optimisation purposes.</p>
<p>First off I point out that although FB Pages are public, Facebook adds rel=&#8221;nofollow&#8221; to all external links posted on users &#038; pages walls, meaning no benefit for seo.<br />
However I have seen a number of SEO-sites claim that adding one of the many RSS feed apps to their fb page and configuring it to auto publish their target site feed will result in the fb link juice flowing back to them.</p>
<p>not so.<br />
<span id="more-218"></span><br />
A cursory glance at the structure of fb pages dispels this myth:</p>
<p>The special tabs that display these feeds are rendered inside special CDATA sections that facebook javascript libraries then parse themselves.  And search engines don&#8217;t crawl this data &#8211; especially in it&#8217;s ugly preprocessed javascript-escaped format.<br />
The only way to display untampered urls within facebook is in a fully fledged application iframe &#8211; and even then these are the poorest inbound links possible as users installing them on their facebook profiles is still optimistically hoping the profile will be a) public in it&#8217;s entirety and b) indexed by Google.</p>
<p>They also ask about page apps like RSS Graffiti, Networked Blogs or Social RSS but the bottom line is it&#8217;s impossible for them to publish indexable links within the public facebook page structure (and besides, some of them mangle your links through their own forwarding service anyway).  So don&#8217;t waste your time &#8211; Faceook links are not an aid to SEO.</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2010/04/24/seo-no-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Emperor Has No Clothes</title>
		<link>http://aleatory.clientsideweb.net/2009/11/23/the-emperor-has-no-clothes/</link>
		<comments>http://aleatory.clientsideweb.net/2009/11/23/the-emperor-has-no-clothes/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 03:00:27 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[delusion of crowds]]></category>
		<category><![CDATA[information media]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/2009/11/23/the-emperor-has-no-clothes/</guid>
		<description><![CDATA[Slacktivism has been exposed as a joke.
Half way through last week a nation erupted; the Republic of Ireland football team crashed out of the World Cup at the hand of Gaul, that of a certain Thierry Henry.  A Facebook group was established.  It took on something of a life of it&#8217;s own &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Slacktivism has been exposed as a joke.</p>
<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2009/11/crowdcontrol.thumbnail.jpg" alt="Angry Mob" style="float: left" />Half way through last week a nation erupted; the Republic of Ireland football team crashed out of the World Cup at the hand of Gaul, that of a certain Thierry Henry.  A Facebook group was established.  It took on something of a life of it&#8217;s own &#8211; over 300k users inside the first 24 hours.</p>
<p>&#8220;Something has to be done&#8221;.</p>
<p>FIFA made no mention of the incident in their official match report.  It was edited several times, each time the Magnum PIs on Twitter reporting to the world the latest breach of instant populist moral values and punch-drunk notions of democracy.  Avatars may not have been coloured green, but the online social network air was turning a particularly dark shade of blue and the feedback loop of increasingly agitated noise fed into itself, reaching a deafening cresendo online while steadily losing touch with reality.<br />
<span id="more-157"></span><br />
Of course the same old predictable new media rubbish was trotted out the next day.  Sky Sports News ran with the facebook group, the Guardian ran with the usual &#8216;Twittersphere exposes FIFA duplicity&#8217; bollocks and generally everything was very &#8216;the power of the web this&#8217;, &#8216;online social network that&#8217;.</p>
<p>And then&#8230; nothing happened.  The irate fans presumably sobered up and went back to whatever they were doing had the South not qualified and the ludicrous calls from the FAI and bandwagon jumping politicians had officially fallen on deaf ears at FIFA.</p>
<p>This left the organiser of the original page on Facebook &#8211; by this stage 400k strong &#8211; to lead a merry band of 150 people with nothing better to do on a Saturday afternoon to the French Embassy in Dublin.  Ably assisted by Dustin the Turkey.</p>
<p>I guess I&#8217;m not doing a complete hatchet job on online campaigning here.  There is a kind of potential value in online networks, but in each case until a method is found to unlock it, it remains just that &#8211; potential.  After all the hullabaloo generated in the RoI football case a conversion rate of just .04% (with some generous rounding on my part) to partake in some form of action highlights what surely is the case for a majority of internet based issues &#8211; that they struggle to make the leap into anything meaningful in the physical world.</p>
<p>Certainly in PR terms it has a discrete value &#8211; albeit one that is more difficult to control.  By saturday, realtime opinion regarding the protest march &#8211; the same medium that had elevated the issue to frontpage news only two days before &#8211; had largely reduced it to a laughing stock:</p>
<blockquote><p>try living in Ireland &#8211; there&#8217;s a march on the French Embassy today. In this weather. I&#8217;m hoping all the idiots drown.<br />
SpodoKomodo <a href="http://twitter.com/SpodoKomodo/status/5917212208"><em>twitter update</em></a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/11/23/the-emperor-has-no-clothes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Cathedral and the Barcamp</title>
		<link>http://aleatory.clientsideweb.net/2009/10/13/the-cathedral-and-the-barcamp/</link>
		<comments>http://aleatory.clientsideweb.net/2009/10/13/the-cathedral-and-the-barcamp/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:10:34 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Tech Labours]]></category>
		<category><![CDATA[cool]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/2009/10/13/the-cathedral-and-the-barcamp/</guid>
		<description><![CDATA[So I attended my first two tech events over the past few days. One good one bad &#8211; here&#8217;s why:
First the good one. I didn&#8217;t really know what to expect from Barcamp Derry and from the spiel delivered online was hoping that was the correct way to approach it. Half hour sessions organised in 3 [...]]]></description>
			<content:encoded><![CDATA[<p>So I attended my first two tech events over the past few days. One good one bad &#8211; here&#8217;s why:</p>
<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2009/10/barcamp.thumbnail.png" style="float: left" />First the good one. I didn&#8217;t really know what to expect from Barcamp Derry and from the spiel delivered online was hoping that was the correct way to approach it. Half hour sessions organised in 3 concurrent &#8217;streams&#8217; meant the first 5 minutes of each was largely spent loitering in the doorway of each until one grabbed enough attention take a pew.</p>
<p><span id="more-137"></span>Although I missed the morning sessions the later half still produced a nice variety of topics &#8211; web media, drupal, startup and a few more. It was refreshing to see stuff happening locally that you usually only read about in front of a screen. Effectively it takes the form of a &#8217;show &amp; tell&#8217; so you get to see stuff that is happening right now in NI. It is accessible and because of that you get an urge to participate and interact in a way you don&#8217;t get from say a lecture for example. You get the sense when people are talking they are thinking aloud and the wide variety of topics really gets you thinking.</p>
<p>The whole experience just seems more realtime.</p>
<p>I&#8217;m no expert on the philosophy of BarCamp but maybe it&#8217;d be an idea to have stream themes so less frantic checking of the timetable matrix would ensue between show &amp; tells. So I could sit down in a room for the day and know I&#8217;d be learning about e.g. bootstrapping, but without necessarily needing to know who is going to speak on it until they begin. It&#8217;d make for a more open minded audience I reckon since they would have little time to research a speakers angle.</p>
<p>Anyway I found the whole thing an engaging and unique experience and am very much looking forward to the next one on 6th November.</p>
<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2009/10/devgarageirl.thumbnail.jpg" style="float: left" />Now the bad one. Facebook Dev Garages are as I understand them a chance for people using/thinking about using the platform to tap into the phenomenol viral power of FB&#8217;s network. If you&#8217;re not into developing apps solely for the Facebook platform, you&#8217;re looking to shoehorn the power of the &#8216;tell your friends&#8217; social tsunami into your existing application.</p>
<p>The first point is it works. My 1st FB app was a simple little gamer gimic that reached 2k MAU (Monthly Active Users &#8211; the standard metric for FB app popularity) within a month, just by adding &#8216;invite your friends&#8217; and &#8216;publish to stream&#8217; components. This would not happen via say Google Gadget directory or dare I say it any of the current appstores. On Facebook, your app is actively pushed through your network by its users. Virality.</p>
<p>It&#8217;s a relatively new paradigm but unfortunately Facebook Inc has turned themselves into another M$, another cathedral: What we got at yesterday&#8217;s Garage was a staid marketing promo. It was a great disappointment &#8211; there is a rich dev ecosystem surrounding the FB platform &#8211; fbFund, the f8 conference and the Dev Garages elsewhere seem to have got the backing they deserved.</p>
<p>So the conversation began at a bird&#8217;s eye view and never really returned to earth.</p>
<p>It could have been so different: At the last minute James Leszczenski, one of the platform dev guys, was roped in. He provided an overview of FB&#8217;s crowdsourced translate app and how it could be used by developers to localise their own FB content. Good talk but again he skipped over the FBML and coding (aka the useful bits) I&#8217;m guessing to avoid glazing half the audience&#8217;s eyes over.</p>
<p>Also maybe it was the travel or whatever but I was expecting him to at least stand for some q&#8217;s at the end of his presentation. He just slunked into his seat. So with the other guys demo not coming off this was basically the end of the Belfast Dev Garage. Some marketing guy and a dev who didn&#8217;t really talk shop &amp; wasn&#8217;t too interested in engaging the audience.</p>
<p>[I asked the InvestNI girl afterwards if there'd be another one in future, maybe with a bit more to it and the response didn't sound too promising. Maybe there isn't the demand currently but surely it's up to the marketing people to get engaging content. Not come here to give a talk on the history of the company and how to create a FB page for your business. There's a tendency for tech firms opening up in Dublin to adopt the shrinkwrapped M$ model of dev engagement. There is very little understanding of what makes a dev ecosystem tick.]</p>
<p>Anyways fair play to the audience at this point, questions were inevitably pointed in his direction and although a percentage of them were irrelevant in a dev context at least it was interaction.</p>
<p>Not of much value though. His answer to the unreliability of the MAU stat availability was publicly &#8220;I&#8217;m sure there&#8217;s a thread on it on the forum&#8221; and privately &#8220;There&#8217;s no reason why you can&#8217;t do your own&#8221;. Which is a load of balls: I could invent the Rutherford Active User tomorrow and you know who would be interested? Nobody that&#8217;s who. Why would they take the time to discover this brand new metric when MAU exists as a platform standard in <em>every</em> app out there? Just fix your own buggy stats thankyouverymuch.</p>
<p>I&#8217;ll admit to getting it wrong on the photos api not being open. Since 2007 to make things worse. But I&#8217;m also going to shift the blame on platform dev docs being an absolute maze to work through. I&#8217;ll stop digging right there. And I was more just pissed off at all the marketing chatter of open this connected that. hmph.</p>
<p>Although Leszczenski did seem a nice guy in person and at least laughed &amp; agreed with my take on Google Wave still being &#8216;the app Google released the day Microsoft launched Bing&#8217;. Not the first time that&#8217;s happened he said, in his best FB disciple knowing look of indignation.</p>
<p>Cathedrals are everywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/10/13/the-cathedral-and-the-barcamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friend of the Stars</title>
		<link>http://aleatory.clientsideweb.net/2009/09/20/friend-of-the-stars/</link>
		<comments>http://aleatory.clientsideweb.net/2009/09/20/friend-of-the-stars/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 22:49:32 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[cool]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/2009/09/20/friend-of-the-stars/</guid>
		<description><![CDATA[Ok so I&#8217;m clicking around Facebook a lot these days looking into the viral aspect of the apps, what does and doesn&#8217;t work, etc, etc.  I can&#8217;t help but pick up on the various hacks people have come up with on built in features, such as tagging any pics you like with your name [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://aleatory.clientsideweb.net/wp-content/uploads/2009/09/facebook-demotivate.jpg' title='facebook-demotivate.jpg'><img src='http://aleatory.clientsideweb.net/wp-content/uploads/2009/09/facebook-demotivate.thumbnail.jpg' alt='facebook-demotivate.jpg' style='float:left;'/></a>Ok so I&#8217;m clicking around Facebook a lot these days looking into the viral aspect of the apps, what does and doesn&#8217;t work, etc, etc.  I can&#8217;t help but pick up on the various hacks people have come up with on built in features, such as tagging any pics you like with your name to browse instantly from your profile.  Or posting up those Mr Men or whatever collages to match up the friend with the trait.</p>
<p>All cool little diversions.  And none requiring you&#8217;re friends to install any 3rd party contraption for the network dimension to be of use.  And I&#8217;ve come up with my own &#8211; seeing how many of the rich and famous I can add to my network.  <span id="more-132"></span>I&#8217;m thinking start off with the Z listers then gradually build up my friend of the stars rep with a self-fulfilling trust network of media <del>whores</del> savvy celebs who crave a platform with the right connections.  Why could that platform not be my friend network?  &#8216;Any friend of Putin is a friend of mine&#8217;, etc, etc.  Once your fellow average joe friends are in on the act facebook network top trumps could ensue:  &#8216;I see your Matt Damon and I raise you Kevin Costner&#8230;&#8217; or whatever.  </p>
<p>Network Wars.  </p>
<p>Surely beats the arse out of the &#8216;network&#8217; features of Mafia Wars (amounting to nothing more than an endless time-restricted &#038; turn-based cycle of &#8217;send x, receive y&#8217;).  I&#8217;ve had a shot at two people already.  Although not famous outside of their domains, I&#8217;ve never met either personally and they&#8217;re well known to enough to kick this off.  For now <a href="http://www.facebook.com/profile.php?id=100000167231927">Putin</a> will just have to wait.</p>
<p>No 1:  <a href="http://www.frankdelise.com/">Frank DeLise</a>    Creator, Desert Combat mod for Battlefield 1942<br />
Let me tell you.  DC for BF1942 was a great, great game.  Basrah&#8217;s Edge, Nights, Al Nas, Bridge, Lost Village, Berlin&#8230; sigh.  And this man is the man.  And I told him as much in my friend request.  &#8216;long time fan, big respect for what you did with DC&#8217;.  Result?  First celebrity (in my head anyway) in the clutches of the Rutherford network.  Mhuahaha. Ha.</p>
<p>No 2:  <a href="http://en.wikipedia.org/wiki/Pamela_Ballantine">Pamela Ballantine</a>    Presenter @ UTV<br />
Went local for my 2nd.  At under 2million we&#8217;re a small (if sometimes stupidly violent) nation, but it&#8217;s still pretty impressive to get your bake on our TVs night after night.  Again, playing the loyal fan card appears to do the job &#8216;long time fan of RPM and it&#8217;s great presenter!&#8217;  Although she did make me wait a week before accepting.  Treat &#8216;em mean keep &#8216;em keen I guess.</p>
<p>So it&#8217;s onto celeb no 3 and I feel like going for a more adventurous target this time.  Will keep you posted in the comments.</p>
<p>While I&#8217;m on the subject of Facebook, anyone else find it disappointing they removed the friend network info feature?  You know &#8211; the breakdown of what networks people&#8217;s friends are from?  Seeing the recent Friends Analysis app reminded me of it and now when I went hunting for it apparently <a href="http://www.facebook.com/help/question.php?id=241093">it&#8217;s been dumped without reason</a>.  Shame, kind of liked seeing the at a glance cultural backgrounds of my own and others networks.</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/09/20/friend-of-the-stars/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Step by Step Guide to Creating a First Facebook App</title>
		<link>http://aleatory.clientsideweb.net/2009/07/05/step-by-step-guide-to-creating-a-first-facebook-app/</link>
		<comments>http://aleatory.clientsideweb.net/2009/07/05/step-by-step-guide-to-creating-a-first-facebook-app/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 23:28:41 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Tech Labours]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/2009/07/05/step-by-step-guide-to-creating-a-first-facebook-app/</guid>
		<description><![CDATA[I&#8217;ve seen some how-to guides for getting started writing facebook apps on the web but none really cover everything from start to finish.  Even Facebook&#8217;s own documentation is somewhat disappointing.  So to help others find their way around Facebook markup and the life cycle of a Facebook application here is a simple tutorial.It [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2009/07/facebook.jpg" alt="facebook" style="margin: 4px; float: left" />I&#8217;ve seen some how-to guides for getting started writing facebook apps on the web but none really cover everything from start to finish.  Even Facebook&#8217;s own documentation is somewhat disappointing.  So to help others find their way around Facebook markup and the life cycle of a Facebook application here is a simple tutorial.It is a very basic app which aims to display a web image of the user&#8217;s choice a) in miniature on their profile, and b) in full on the application&#8217;s own canvas page.  What is a canvas page?  Simply the main page of your application that the user sees each time they click on your app.</p>
<p><strong>Prereqs:</strong><br />
What you&#8217;ll need &#8211; an account on Facebook and a web hosting provider who will run php scripts and allows you to set up a database.  I use mysql in this guide, but you can safely leave out the db steps if all you want to learn is the facebook-specific work flow stuff.<br />
<span id="more-118"></span><br />
<strong>Step 1:  Setting things up on Facebook.com</strong><br />
A Few things here -<br />
1) Add the Facebook <a href="http://www.facebook.com/developers/">Developer Application</a> to your profile if not done so already.<br />
2) Set up new app, give it a name.  Enter in the following details:<br />
Canvas Callback URL &#8211; the full url of the canvas page to be stored on your server.<br />
Canvas Url &#8211; the unique name for your app @http://apps.facebook.com/<yourappnamehere>.  You can flesh it out with icons, descriptions, etc too.<br />
3) Once you get the hang of things it becomes obvious two app instances are needed for each separate application you create &#8211; one live and one test.  However for the sake of brevity I&#8217;ll continue with a single instance.</yourappnamehere></p>
<p>Now it&#8217;s time to create your viral hit.  Download the client libs of your choice and we&#8217;ll look at how to create a setup page for users that wish to add your app.  For this demo I&#8217;ll be using the <a href="http://wiki.developers.facebook.com/index.php/PHP">official PHP client</a>.What we&#8217;ll be doing is showing a simple image.  We&#8217;ll go through all use cases a user will walk through over the lifetime of a facebook app together with the main social networking elements that make the facebook platform such a powerful medium for app developers.</p>
<p><strong>Step 2:  Config on your side</strong><br />
Now for the config in your php script.  Go to the file you entered in as the Canvas Callback URL &#8211; this is the jump-off point for all calls from Facebook to your application.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Include the Facebook client library</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'facebook.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Set authentication variables</span>
<span style="color: #000088;">$appapikey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;yourkeyhere&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$appsecret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;yoursecrethere&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$facebook</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #000088;">$appapikey</span><span style="color: #339933;">,</span> <span style="color: #000088;">$appsecret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// I also will be accessing my own database on almost every call so will set db up here</span>
<span style="color: #000088;">$username</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourusername&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourpassword&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$database</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourdb&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span>localhost<span style="color: #339933;">,</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$database</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Unable to select database&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You are now ready to interact with the Facebook api.</p>
<p><strong>Step 3:  Where to begin?</strong><br />
This was the first &#8211; and most dogged &#8211; question I asked myself when creating my first Facebook application.  As it turns out the workflow is quite like any other web app, with a few bells and whistles tacked on.</p>
<p>Let&#8217;s imagine for a second that user A already has our completed app installed.  User Bthen comes across it on User A&#8217;s profile, so they click through to the app&#8217;s canvas screen.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$url = '';
if(!($_GET['user']==NULL||$_GET['user']=='')){
//user wants to see someone elses profile
$user = $_GET['user'];
if(preg_match('/^[0-9]+z/', $user)){
//use id to retrieve img url from db
$query = 'select * from turl where userid = '.$user;
$result=mysql_query($query) or die(&quot;Couldn't execute query&quot;);
$url=mysql_result($result,0,&quot;url&quot;);}?&gt;&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;</pre></div></div>

<p>The above code looks for a &#8216;user&#8217; variable in the http query.  If it finds it (i.e. not null) it looks up the image url stored for the user sought (User A in this case) and displays.</p>
<p>I should also tell you a bit about the database at this stage.  It is simply a single table (turl) holding two fields url and userid (as in facebook userid).</p>
<p>So we have one use case.  But what if it&#8217;s user A who is clicking through to their own canvas page?  Should we make any additions?  Yes &#8211; we should give them the option of adding the image to their profile if they haven&#8217;t done already.  Fortunately interactions like this that deal with Facebook UI and concepts such as profile can be easily taken care of declaratively through Facebook Markup Langauge (FBML).  Here we add:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">==</span><span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">users_getLoggedInUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//user is looking at their own profile</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span> <span style="color: #339933;">&lt;</span>p <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;section_button&quot;</span><span style="color: #339933;">&gt;&lt;</span>fb<span style="color: #339933;">:</span>add<span style="color: #339933;">-</span>section<span style="color: #339933;">-</span>button section<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;profile&quot;</span><span style="color: #339933;">&gt;&lt;/</span>fb<span style="color: #339933;">:</span>add<span style="color: #339933;">-</span>section<span style="color: #339933;">-</span>button<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>api_client<span style="color: #339933;">-&gt;</span><span style="color: #004000;">users_getLoggedInUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://apps.facebook.com/&lt;yourappname&gt;&quot;</span><span style="color: #339933;">&gt;</span>Add your web image<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;,</span> <span style="color: #b1b100;">if</span> you haven<span style="color: #0000ff;">'t already!}</span></pre></div></div>

<p>If the user is looking at their own web image but hasn&#8217;t yet displayed it on their profile (either in the boxes tab or on the left hand strip on their wall tab) they will see the add to profile image below:</p>
<p><img src="http://aleatory.clientsideweb.net/wp-content/uploads/2009/07/fb-addtoprofile.PNG" alt="Add to Profile" /></p>
<p>The else statement checks if it&#8217;s another users image page and if so a rudimentary viral feature appears &#8211; asking the viewer if they want to try the app out too.</p>
<p><strong>Step 4:  Allowing a new user to preview</strong><br />
OK so back to User B.  Having clicked through to User A&#8217;s web image they like what they see &#8211; now they want to try things out for themselves.  At this stage some FB devs like to force the user to install the app &#8211; with a call to $facebook-&gt;require_login() &#8211; before they can try it out for themselves.  I don&#8217;t know about you but personally I find this a very annoying feature of 99% of FB apps so as a developer I want to give my users the option to preview their app first.</p>
<p>There is a drawback though.</p>
<p>$user = $facebook-&gt;require_login() is a really simple way of getting the user id, something you will need for virtually all meaningful interactions with the platform API.  Otherwise there are all sorts of possible ways a user can land on your canvas page without their user id being specified in the various Facebook ID fields sent with each request.  For example a user could enter the app url directly into the browser address bar or open from an email link.</p>
<p>Because the platform isn&#8217;t an exact science as such, with features, availability, etc changing quite a bit I&#8217;ve hacked around something that appears to work for me, i.e. it gets user ids in most situations without forcing an install on the user:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">}else{
if(!(($_GET[&quot;fb_sig_canvas_user&quot;]==NULL) ||($_GET[&quot;fb_sig_canvas_user&quot;]==''))){
$user = $_GET[&quot;fb_sig_canvas_user&quot;];}
elseif(!(($_REQUEST[&quot;fb_sig_user&quot;]==NULL) ||($_REQUEST[&quot;fb_sig_user&quot;]==''))){
$user = $_REQUEST[&quot;fb_sig_user&quot;];}
else{
$user = $facebook-&gt;api_client-&gt;canvas_user;}
if(($user==NULL)||($user=='')){
//if not already, try redirect
if (!isset($_REQUEST['reload'])){
$facebook-&gt;redirect($app_base_url.'?reload');}
else{?&gt;&lt;span&gt;You must be logged into Facebook to access web image&lt;/span&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Step 5:  how to track your user base</strong><br />
Users.isAppUser has come under a lot of criticism.  Well, from me at least.  Because it only records if a user has previously authorised an app, and not if the app is currently authorised, facebook platform currently has no sure way of knowing if it is installed by a user right now.  So we create our own solution with the previously mentioned db table turl.  Turl&#8217;s two fields userid &amp; url tell us if the user has authorised the app (userid is present) and what web image they have displayed (url).  So now that we have the user id, we check for authorisation:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//set isAppUser</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'select * from turl where userid = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #339933;">;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Couldn't execute query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
<span style="color: #000088;">$isAppUser</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #000088;">$isAppUser</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>if authorised we get the image url and show it on the canvas:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">if($isAppUser){
//display gfx, webform
$user = $facebook-&gt;require_login();
$query = 'select * from turl where userid = '.$user;
$result=mysql_query($query) or die(&quot;Couldn't execute query&quot;);
$url=mysql_result($result,0,&quot;url&quot;);?&gt;&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;p class=&quot;section_button&quot;&gt;&lt;fb:add-section-button section=&quot;profile&quot;&gt;&lt;/fb:add-section-button&gt;&lt;/p&gt; }</pre></div></div>

<p><strong>Step 6:  Adding a user proper</strong><br />
We&#8217;re on our 6th step so lets take stock of where we are.  We&#8217;ve taken into account a user viewing another users canvas page and also a user viewing their own page.  We&#8217;ve also got the user&#8217;s id and, assuming a user&#8217;s been added to the database successfully, can tell if they have installed the app.  Now we can begin to comtemplate how a user is added to our database.</p>
<p>First we should deal with the preview:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> else{
?&gt;&lt;span&gt;Want to display a web image of your choice on Facebook?  Enter the url here:&lt;/span&gt;&lt;form action=&quot;.&quot; method=&quot;get&quot;&gt; &lt;input name=&quot;url&quot; type=&quot;text&quot; /&gt; &lt;input value=&quot;Preview&quot; type=&quot;submit&quot; /&gt;&lt;/form&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And so we have the above catchall statement added if the user is not currently using the app, inviting them to preview it.  Once this form is submitted by the user we need to show the preview, so we include the following case before the form:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> elseif(!($_GET['url']==NULL||$_GET['url']=='')){
$url=$_GET['url'];?&gt;&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;span&gt;Happy with this?  Click to install app&lt;/span&gt;&lt;form action=&quot;.&quot; method=&quot;get&quot;&gt; &lt;input value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; name=&quot;url&quot; type=&quot;hidden&quot; /&gt;&lt;input name=&quot;add&quot; type=&quot;hidden&quot; /&gt; &lt;input value=&quot;Add Web Image&quot; type=&quot;submit&quot; /&gt;&lt;/form&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now we also have the preview step.  If the user wants to install at this stage we go ahead with the obligatory warning page and then we can perform the main installation tasks.  So another case goes in above the previous one:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'add'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$user</span><span style="color: #339933;">=</span><span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">require_login</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//once authorised FB forwards the user with all existing request variables - back to this page, so we can continue installation on our side</span>
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>url<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;insert into turl values ('<span style="color: #006699; font-weight: bold;">$user</span>','<span style="color: #006699; font-weight: bold;">$url</span>')&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fbml_profile</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;http://apps.facebook.com/&lt;yourappname&gt;/?user='</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;182&quot; height=&quot;182&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span><span style="color: #000088;">$fbml_boxes</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;http://apps.facebook.com/&lt;yourappname&gt;/?user='</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;360&quot; height=&quot;100&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">profile_setFBML</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fbml_boxes</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fbml_profile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After the user authorises the application we add the user to our db and also set the fbml markup for displaying the chosen web image on their profile wall or boxes tab.</p>
<p><strong>Step 7:  Adding Viral Features</strong><br />
Along with maybe the application directory, this is the most powerful aspect of the Facebook platform for developers.  Given the right incentives/marketing/branding/whatever you wish to call it, apps on facebook can spread like wildfire.  We will implement two features commonly used by FB developers to reach the tipping point &#8211; app invites and newsfeed stories.</p>
<p>Both are normally done at app sign up time and are used to inform members of the users personal network.  But they differ in that an invite is an explicit question targeted at friends of the user&#8217;s choice while adding it to a users newsfeed merely passively notifies people that they are using your application.  It&#8217;s harder to get a user to send out invites because they aren&#8217;t always welcome but if a user does target them successfully it may lead to a higher sign up rate amongst their friends.</p>
<p><strong>Step 7a:  Application Invite</strong><br />
First the app invite.  It takes the form of <a href="http://wiki.developers.facebook.com/index.php/Multi_friend_selector">more FBML</a> and presents itself in a separate page pretty much like the authorisation page, before redirecting the user back to our page again.  You don&#8217;t want the user to send out any to friends who already have the application, so here&#8217;s the code to display only those who don&#8217;t yet have them:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  $fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND has_added_app=1';$_friends = $facebook-&gt;api_client-&gt;fql_query($fql);
// Extract the user ID's returned in the FQL request into a new array.
$friends = array();
if (is_array($_friends) &amp;&amp; count($_friends)) {
foreach ($_friends as $friend) {$friends[] = $friend['uid'];}}
// Convert the array of friends into a comma-delimeted string.
$friends = implode(',', $friends);
// Prepare the invitation text that all invited users will receive.
$content = &lt;&lt;&lt;fbml&gt;&lt;fb:name shownetwork=&quot;false&quot; firstnameonly=&quot;true&quot; uid=&quot;{$user}&quot;&gt; wants to see your web image!&lt;fb:req-choice label=&quot;Add Your web image to your profile&quot; url=&quot;{$facebook-&gt;get_add_url()}&quot;&gt;FBML;?&gt;&lt;fb:multi-friend-selector exclude_ids=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$friends</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rows=&quot;5&quot; showborder=&quot;true&quot; actiontext=&quot;Invite your friends not yet displaying their web image&quot; max=&quot;20&quot;&gt;&lt;/fb:multi-friend-selector&gt;&lt;/fb:req-choice&gt;&lt;/fb:name&gt;&lt;/fbml&gt;</pre></div></div>

<p><strong>Step 7b:  Wall Story</strong><br />
The <a href="http://wiki.developers.facebook.com/index.php/Feed.publishUserAction">Wall story request feature</a> is implemented as a popup using FBJS &#8211; the subset of javascript allowed on Facebook canvas pages.  It is slightly more complex than that unfortunately &#8211; you need to create a feed template first to describe the format of the story that will appear on users newsfeeds.</p>
<p>Go to the <a href="http://developers.facebook.com/tools.php?feed">template editor tool</a> to begin.  We&#8217;ll create a simple feed that shows your application logo and invites people to try it or view their friends web image.  First choose your application then create a one liner, note the special markup involved to allow personalisation.  3 main bits to note in this:</p>
<p>Short story template title &amp; body:<br />
Add in your message -&gt; &#8220;{*actor*} added their web image&#8221;</p>
<p>Sample template data: very important for ensuring your story appears how you wish.  Use it to experiment.</p>
<p>Action Link URL:To give friends a way of viewing the user&#8217;s own web image, enter the following -&gt; &#8220;http://apps.facebook.com/<yourapppage>/?user={userid}&#8221;</yourapppage></p>
<p>Click through next, Register Template Bundle and note down the ID generated.  It can get more powerful than this but it&#8217;s quite error prone for a beginner so lets keep things simple.  We&#8217;re halfway there &#8211; now back to your php code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> &lt;script type=&quot;text/javascript&quot;&gt;
var tpl_data={&quot;status&quot;:&quot;status&quot;,&quot;images&quot;:[{&quot;src&quot;:&quot;&lt;yourapplogo&gt;&quot;, &quot;href&quot;:&quot;http://apps.facebook.com/&lt;yourapppage&gt;&quot;}],&quot;userid&quot;:&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span>user<span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;};
var user_msg = {&quot;value&quot;:&quot;&quot;};
var share_msg = &quot;share with your friends&quot;;
Facebook.showFeedDialog(&lt;feeddialogid&gt;, tpl_data, &quot;&quot;, &quot;&quot;, null, share_msg, user_msg);&lt;/script&gt;&lt;fb:request-form content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;web image&quot; invite=&quot;true&quot; method=&quot;POST&quot; action=&quot;http://apps.facebook.com/&lt;youapppage&gt;/&quot;&gt;&lt;/fb:request-form&gt;} &lt;/yourapplogo&gt;</pre></div></div>

<p>Enter your feed dialog ID in the code above, together with your app logo url, etc.  As you can maybe workout, we substitute the the real data needed in tpl_data in place of the sample template data you seen in the feed templating tool.  Note we pass in our own user variable, necessary to know which users image the friend wants to view.</p>
<p><strong>Step 8:  Deleting user records</strong><br />
Almost done.  A user now can view other users web images &amp; install one on their own profile.  But what happens when a user deletes the app?  To avoid our database potentially filling up with duplicate user accounts (and if we want to keep an accurate record of the total number of installed users), we must create a 2nd php script that Facebook can call when a user deletes our app.</p>
<p>To do this, create a 2nd script on your web host then go back into the FB <a href="http://www.facebook.com/developers">dev application</a>, click on the &#8216;more&#8217; tab of our app then &#8216;edit settings&#8217; -&gt; &#8216;authentication&#8217; -&gt; &#8216;Post-Remove Callback URL&#8217;.  Enter in the full URL of this script.  All we need to do is delete the user from our db:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Include the Facebook client library</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'facebook.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Set authentication variables</span>
<span style="color: #000088;">$appapikey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;yourkeyhere&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$appsecret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;yoursecrethere&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$facebook</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #000088;">$appapikey</span><span style="color: #339933;">,</span> <span style="color: #000088;">$appsecret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_loggedin_user</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fb_params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'uninstall'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//The user has removed your app</span>
<span style="color: #000088;">$username</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourusername&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourpassword&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$database</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;yourdb&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span>localhost<span style="color: #339933;">,</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$database</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Unable to select database&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'delete from turl where userid = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #339933;">;</span>mysql_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Couldn't execute query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And that&#8217;s that!  A working Facebook application from the ground up with several important features explained.</p>
<p>For a complete listing of the code check out google docs <a href="http://docs.google.com/View?id=dhshn36t_44chw8bccj">add.php</a> &amp; <a href="http://docs.google.com/View?id=dhshn36t_46db48szcr">remove.php</a></p>
<p>Need a more in-depth explanation?  In my opinion the book that offers the most clarity on the subject is <a href="http://www.amazon.com/gp/product/059651817X?ie=UTF8&amp;tag=basrnigh-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059651817X" target="_blank">Facebook Cookbook: Building Applications to Grow Your Facebook Empire</a> <img src="http://www.assoc-amazon.com/e/ir?t=basrnigh-20&amp;l=as2&amp;o=1&amp;a=059651817X" onmouseout="undefined" onmouseover="undefined" vspace="0" width="1" border="0" height="1" hspace="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/07/05/step-by-step-guide-to-creating-a-first-facebook-app/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Playstation Gamer Tag</title>
		<link>http://aleatory.clientsideweb.net/2009/06/15/playstation-gamer-tag/</link>
		<comments>http://aleatory.clientsideweb.net/2009/06/15/playstation-gamer-tag/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 22:48:01 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=115</guid>
		<description><![CDATA[Just finished release 1 of a nice and simple Facebook app that allows you to show off your Playstation Portable ID to your network.  It shows among other things your last played online game and your trophy list including a breakdown across platinum, gold, silver &#038; bronze.
Here is mine as an example

This gucci Portable [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished release 1 of a nice and simple Facebook app that allows you to show off your Playstation Portable ID to your network.  It shows among other things your last played online game and your trophy list including a breakdown across platinum, gold, silver &#038; bronze.</p>
<p>Here is mine as an example<br />
<img src="http://mypsn.eu.playstation.com/psn/profile/btnine.png" alt="btnine" /></p>
<p>This gucci Portable ID that displays trophy count is only available from Playstation&#8217;s EU community site and so this is why Gamer Tag instructs the user to register there.  The process is quite labourious but to help there is a great step-by-step guide at <a href="http://itrophies.wordpress.com/gamercard/">iTrophies</a>.</p>
<p>As my first Facebook app I was surprised at the incomplete nature of documentation available, especially on the official dev site itself.  Although concepts became less hazy by the time I fleshed out the full application life cycle it took a while for the building blocks to fall into place.  The multi-dimensional nature of developing for the Facebook platform &#8211; i.e. working across 3 domains each with their own specific script or markup language &#8211; made for a trial and error development experience.</p>
<p>There are a lot of different paths into a facebook app and thus the challenge comes in creating a bullet-proof application that will withstand the many methods users will find to get to my little app.  Storyboarding the various steps in signing up users helps immensely and can be safely broking down into a number of discrete steps.</p>
<p>This is definitely something that merits further discussion so look out for a tutorial somewhere in the not-too-distant future.</p>
<p>You can try it out for yourself <a href="http://apps.facebook.com/psngamertag">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/06/15/playstation-gamer-tag/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>That Big a Deal?</title>
		<link>http://aleatory.clientsideweb.net/2009/04/27/that-big-a-deal/</link>
		<comments>http://aleatory.clientsideweb.net/2009/04/27/that-big-a-deal/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 22:54:37 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=103</guid>
		<description><![CDATA[Facebook opened up it&#8217;s user activity streams to the public API today. &#8220;This is a big deal.&#8221; says TechCrunch, referencing an earlier article on the wider implications for micromessaging, likening it to AOL offering email to the masses.
But is it?
The chief upshot of this will be a mass of desktop and mobile activity updaters. I [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook <a href="http://www.techcrunch.com/2009/04/27/facebook-opens-up-its-stream-api-to-developers/">opened up</a> it&#8217;s user activity streams to the public API today. &#8220;This is a big deal.&#8221; says TechCrunch, referencing an earlier article on the <a href="http://www.techcrunchit.com/2009/04/26/facebook-drops-other-shoe-tomorrow/">wider implications</a> for micromessaging, likening it to AOL offering email to the masses.</p>
<p>But is it?</p>
<p>The chief upshot of this will be a mass of desktop and mobile activity updaters. I don&#8217;t yet have a Twitter desktop app, due to the fact I don&#8217;t want to read tweets in realtime. I like to browse a snapshot of the days events in my own time and not as a distraction. Ok so occasionally tweets and work do synergise to produce a new idea or extra insight to an old one, but the fact is the motley collection of fellow users I follow will always mean a high signal to noise ratio in terms of whatever it is I&#8217;m working on *right now*. Hence no realtime feed, no constant blast of interestingness.</p>
<p>Neither do I have an activity stream app on my mobile. And I won&#8217;t while the internets are still charged by the megabit.</p>
<p>So no, I really don&#8217;t think this is <em>that</em> big a deal. If anything I think it&#8217;ll create a backlash, certainly in the mainstream, that up to now appeared warmly receptive to the usefulness of a service such as Twitter in terms of a primary news source. Yes for 90% of people that meant following Stephen Fry, but it was adoption nonetheless.</p>
<p>Instead people will now be bombarded with a hail of disparate apps all doing pretty much the same thing with a slightly different flavour. I think the time has come to split, not aggregate, all these feeds. I had given some thought to submit such an idea for content creators to a <a href="http://www.digitalcircle.org/2009/04/07/technology-strategy-board-competition-for-creative-industries/">recent competition</a> for funding. But I&#8217;ll let the crazies crack on for now</p>
<p><strong>Update</strong>: Things change fast. Especially when FB <a href="http://www.techcrunch.com/2009/04/27/facebook-first-big-site-to-really-embrace-openid/">invite the devs round</a>. My <a href="http://twitter.com/rutherford/status/1630073645">earlier twittering</a> regarding OpenId or FB Connect now appears deprecated</p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/04/27/that-big-a-deal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trusting Facebook Apps&#8230;</title>
		<link>http://aleatory.clientsideweb.net/2009/04/10/trusting-facebook-apps/</link>
		<comments>http://aleatory.clientsideweb.net/2009/04/10/trusting-facebook-apps/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 10:59:41 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=95</guid>
		<description><![CDATA[Facebook security policy places your trust of third party apps in the hands of your friends &#8230;by default! First of all, to rectify your own account, go to FB&#8217;s privacy page and unselect everything your uncomfortable with &#8211; I unchecked all bar my profile pic &#8211;  only came across this after a chance reading [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Verdana; font-size: 13px; line-height: normal" class="Apple-style-span">Facebook security policy places your trust of third party apps in the hands of your friends &#8230;by default! First of all, to rectify your own account, go to FB&#8217;s <a href="http://www.facebook.com/privacy/?view=platform&amp;tab=other" style="color: #551a8b">privacy page</a> and unselect everything your uncomfortable with &#8211; I unchecked all bar my profile pic &#8211;  only came across this after a chance reading of <a href="http://news.zdnet.co.uk/security/0,1000000189,39389297,00.htm" style="color: #551a8b">zdnet</a>.<br />
<br/><br />
Before you change these settings the apps your friends install have instant access to your employment history, political views, etc, etc all out of the box.  I&#8217;ve nothing against my fb-connected friends but some of the apps they blindly opt into had me googling up how to dig into FB&#8217;s arcane maze of options in a mild panic.<br />
<br/><br />
Don&#8217;t get me wrong, they do win at letting you customise to your hearts content, what with blacklists, whitelists and any combination thereof, but to leave something like this as the standard setting is pretty crazy imo.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/04/10/trusting-facebook-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Mover Advantage?</title>
		<link>http://aleatory.clientsideweb.net/2009/02/23/first-mover-advantage/</link>
		<comments>http://aleatory.clientsideweb.net/2009/02/23/first-mover-advantage/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 15:59:58 +0000</pubDate>
		<dc:creator>rutherford</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://aleatory.clientsideweb.net/?p=79</guid>
		<description><![CDATA[TechCrunch recently covered the phenomenol rise of FB photos over existing well established image stores such as Flickr.  First mover advantage was always a big draw in the first dot com rush, yet the debate around FMA and what is termed &#8216;fast second&#8216; is a mature one in other industries.  Size versus speed.  I wonder is the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.techcrunch.com/2009/02/22/facebook-photos-pulls-away-from-the-pack/">TechCrunch</a> recently covered the phenomenol rise of FB photos over existing well established image stores such as Flickr.  <a href="http://en.wikipedia.org/wiki/First-mover_advantage">First mover advantage</a> was always a big draw in the first dot com rush, yet the debate around FMA and what is termed &#8216;<a href="http://en.wikipedia.org/wiki/Fast_second">fast second</a>&#8216; is a mature one in other industries.  Size versus speed.  I wonder is the web conforming to a more balanced ratio in this regard?  A look around gives mixed signals -
<ul>
<li><span style="font-weight: bold" class="Apple-style-span">Twitter</span>  One of the hottest web properties today.  A resounding success thanks to FMA.  Just don&#8217;t mention the business plan.</li>
<li><span style="font-weight: bold" class="Apple-style-span">Friendster</span>  Big in the Asia-Pacific region (I&#8217;m not sure if that&#8217;s the web equivalent of stating a musician is &#8220;big in Germany&#8221;) but has fallen behind FB &amp; MySpace in Western online society.  Imo FB&#8217;s rep for being a college student&#8217;s thing got it viralling and the API sealed it&#8217;s dominance in the long term.</li>
<li><span style="font-weight: bold" class="Apple-style-span">iPhone App Store </span> Certainly got developers excited, but then wouldn&#8217;t the devs who like to be known as creatives already have iPhones in the first place?  The proliferation of announced app stores for the various mobile platforms since merely means the commoditisation of the idea and another wall around each silo.  First mover advantage will mean little in this regard.</li>
<li><span style="font-weight: bold" class="Apple-style-span">Amazon Elastic Compute Cloud</span>  Amazon went at it full pelt &#8211; access to root, command line, the whole server OS.  A brave move.  Second out of the blocks was Google&#8217;s App Engine, offering a much more restricted/simplified Python-based service depending on how you look at things.  Crucially though it allows devs to play for free &#8211; that together with the &#8220;it&#8217;s Google&#8221; factor give it a much greater monthly pageview traffic than EC2&#8217;s homepage.  But it&#8217;s cpu cycles that measure the success here and EC2 already bears the hallmarks of an enterprise-ready app <a href="http://www.techcrunchit.com/2008/10/23/the-cloud-is-shaping-up-amazon-beefs-up-ec2-bechtolsheim-shifts-his-attention-to-arista-networks/">in a production environment with a standard SLA in place</a>.  Too early to call then, but investors have been asking for <a href="http://www.datacenterknowledge.com/archives/2009/02/02/is-amazons-cloud-profitable/">more visibility</a> on Amazon Web Services in general, so definitely a future battleground.</li>
</ul>
<p>Has first mover advantage disappeared then from the web?  Although many breakthrough applications have been superceded by bigger and better alternatives with a far greater leverage, none are by any means rendered dead in the water because of it.  And neither are the fast seconds always some massive corporation throwing money at the latest buzzwords; Zooomr established itself by providing a slightly more <a href="http://thomashawk.com/2006/08/photo-portal-notes-at-zooomr.html">interactive interface</a> for what is in effect an online storage bucket.   So I guess the answer is &#8220;it depends&#8221;. </p>
]]></content:encoded>
			<wfw:commentRss>http://aleatory.clientsideweb.net/2009/02/23/first-mover-advantage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
