Tag Archives: facebook

Facebook Send

In a recent post on the Facebook blog they announced updates to their group functionality, which currently isn’t really a function I use, although I can see the benefit of using groups. Buried near the bottom of the post and later picked up by Mashable was an announcement about a new piece of functionality not for the Facebook site but to be found on sites outside of Facebook.

In addition to the other new group features, we’re also introducing the Send button.

Similar to the “Like” button, it seems a “Send” button has been developed which can be placed on your site. At the moment it appears only on a small number of sites (about 50), but if it is successful on these sites I don’t see any reason why it wouldn’t be rolled out as a social plug-in in a similar fashion to the “Like” button.

This new functionality interests me for two reasons:-

  • Functionality such as this is abundant on sites and microsites in the form of a forward to a friend.
  • It further cements Facebook as a facilitator of communication.

Forward to a Friend

I’ve lost count of the times I’ve implemented this functionality on a site. Its not particularly challenging to implement functionally, but it is actually pretty hard to make it work well technically. Forget the fact that IMO this functionality rarely gets used, it is nevertheless added to so many sites alongside the almost equally as pointless share icons. What you don’t really tend to see is whether the form you submit ever actually ever reaches its recipient.

The reason for this is that web servers don’t make very good email servers. Sure it is easy to actually send email but to make it get to its destination is very unlikely to happen. The reason for this is that the email has to come from someone, usually the person filling out the form. When this email is sent the receiving server checks where the email has come from and if it isn’t from where the email domain should be coming from it is likely to mark it as spam.

The benefit of using Facebook for this is therefore two-fold, you reduce the implementation cost as it will essentially just be a quick plug-in, and you also increase the likelihood of it actually working! Whether it will actually be used is another thing entirely.

Facebook Replacing Email

Email is old, and if you believe some statistics 45% of all emails sent are spam. Communication has moved on considerably over the last few years and the one-size fits all solution which is email doesn’t really fit anymore.

Don’t believe me then I ask you when was the last time you tried to arrange something over email? And when was the last time you did it through Facebook, be it via an event of via FB message? Which was more successful? Our social worlds live on Facebook and for most people its just easier to communicate through Facebook than through email now, but only for this specific use-case.

Now I’m not suggesting that email will entirely be replaced, it use is so varied especially in business but you could say that it may be replaced for certain types of communication. Up until now the only Facebook mail has really only been used within Facebook, moving it into a wider context broadens the scope for its use, Forward to a Friend is just one use-case there may be many more for which Facebook may be a “better” solution than email.

Of course there is an argument that such an important channel should not be in the control of one corporation but I think we are far beyond the point where that argument is even relevant anymore, Facebook simply is the social channel.

Anti-Social Games

I’ve waited a while to write this blog post, and it really has been a while. 18 months ago I wanted to see what all the fuss was about with regards to Facebook games such as FarmVille, little did I know how much it would suck me in. The idea of planting virtual crops didn’t really appeal to me, still doesn’t, so I chose another of Zynga’s social games Mafia Wars. This post has been inspired by the fact I am approaching Level 1000!

Now what you need to bear in mind with this is that on an average day as a player I am lucky to advance 2 levels. It is a game which gets harder to level the higher you get. I have literally had to play the game everyday for 18 months, and when I say everyday it really is practically everyday (just ask my long suffering wife), my current streak is about 300 consecutive days. Yes over this period of time at least once a day I have logged on to Facebook and into the MW app and performed the same monotonous tasks.

You see I joined to see if it was fun to play games socially and what has actually happened is that I pretty much play the game by myself, largely ignoring the social options and actually hating the fact that the game would be easier if I had a lot of friends as addicted as I was who would actively get social about it.

Its not the first time I’ve been taken in by this sort of thing, I also got sucked in by the spymaster twitter game which consumed many an hour of my life. Both of these games tapped into something I didn’t expect, an OCD of sorts which makes me want to complete collections.

For the un-initiated amongst you MW basically has two main actions, fighting and jobs (there’s more than this but at its basic level this is it). The game is currently compartmentalised into cities, in each city you have a number of tasks to complete. Complete the tasks and complete the city.

You have two stats to spend in the game, energy and stamina, energy is use for jobs and stamina is used in fights. You have a finite amount of each stat which recharges over time. So basically if you have used all your energy/stamina you can’t do anything till it recharges which generally takes a long time. There are other vital stats as well such as health, attack and defense points which define how good you are at fighting.

The fighting aspect of the game is I guess what you can call the social side of the game and its largely the part I dismissed. I am essentially addicted to the game play, not because it is difficult but because it is obscenely simple, repetitive and seemingly never ending.

The point here is that whilst the social aspect of games such as MW is what a lot of people focus on I think Zynga need to be given a bit more credit here. Yes the game is popular because of the social aspect and its ability to tap into the long-tail of users, but the actual mechanic is brilliant (well for me). Social is obviously all the rage but its good to know there’s still room for a good old fashioned game concept. I’ve tried other Zynga games such as CityVille, but these games require me and my friends to get social to progress at any rate, something I’m not prepared to do.

Like most addicts, admitting I have a problem is the first step. The next step is to break the addiction. I’m so close to finishing the game it should be over for me soon, but no Zynga have gone and released a new city… DAMN YOU ZYNGA!

No Such Thing as a Free Lunch

So Twitter has cause a mini storm by turning on its developer ecosystem. Anyone who didn’t see this coming have been very naive. Any business who utilises a third-party system such as the APIs/Platforms/Marketplaces in order to make money doesn’t have a business built on solid foundations.

Sure you can argue that it is the developers who have made Twitter or Facebook or Apple or ANother service popular but at the end of the day these are the companies who hold all the cards. They are free to change their terms and conditions as they see fit. People may call foul but ultimately these companies are here to make money and they will do so as they please. The only way around this is to be the company holding the cards.

Would I still develop a Facebook App for a client, or an iOS app etc. You bet I would, but if it was for me my eyes are open, if it is for a client then I would have a duty to open their eyes as well. Don’t like this then vote with your feet, don’t utilise this platform, or except the risks. Beware the third-party, especially if the service is “free”.

The ‘Like’ Convention

With a $75 Billion dollar valuation and who knows how many users now its pretty clear that Facebook is huge. But here’s an interesting tidbit from a recent blog post by Instapaper who have just release version 3.0 of their app.


Nobody knew when or why to use Stars, so I’ve renamed them to Likes to clarify their purpose. Generally, you should Like articles that you think are interesting and that you might recommend to others.

Starring items to indicate they are your favourite, or that you rate them has long been considered a convention. Just look at your browser and how the star is used for your bookmarks or favourites. This has then translated into other web apps, Google Reader, Twitter etc.

Facebook however took a slightly different approach and instead of the more personal star they chose to use the ‘like’ metaphor, more to indicate to others that you rate an item, than for yourself. This approach has since broken free of the Facebook walls and can be found just about everywhere on the web.

To ‘Like’ something has effectively started to replace the ‘Star’ metaphor. A simple demonstration of how Facebook has changed the game.

Of course how this data is used has also changed but social bookmarks have been around for years so I won’t discuss how the data can then be used.

Facebook Open Graph

Now that the initial rush revolving around adding “Like” buttons to a site has died down a bit I’ve decided to revisit it a bit. Of course having spent a little more time researching and reading the docs it seems my initial implementation was a little off, well not for adding the like button but in terms of the wider Open Graph protocol. If you want to share in the Open Graph goodness there’s a bit more that you need to do to your site, I for one believe these extra steps are worth doing, especially if you look at it taking into account the direction Facebook seems to be taking, more on that later.

First whats wrong with my original implementation? Well in terms of showing the “Like” button there was nothing wrong, but being the curious little bee I am I want looking to see if I could find information on who had “Liked” my page. My understanding was that if you know the ID of the object which is being “liked” then you can find out more about it using the Facebook Open Graph API but how do you find out the ID of your site that has the “Like” button on it?

My first attempt was to fire up Firebug and inspect the “Like” button code to see if the ID was contained within. Not much luck there I’m afraid. I then had a thought why not use the Open Graph itself to find out the ID, I “Liked” the page so surely I could use myself as the starting point and see what I liked to get the the ID of the page. Using the URL: https://graph.facebook.com/me/likes returned me a JSON object like this:

{
   "data": [
      {
         "name": "Billy Joel",
         "category": "Musicians",
         "id": "57084011597"
      },
      {
         "name": "Muse",
         "category": "Musicians",
         "id": "8762738724"
      },
...
   ]
}

Unfortunately my site wasn’t in this list, it wasn’t part of the Open Graph. At this point I obviously suspected something was wrong and did what any good developer should have done from the start and read the documentation. Having the “like” button on the page isn’t enough to satisfy being in the Open Graph you also need to add meta data to the page for it to show up. Fortunately this is pretty easy (as always) in wordpress. Edit the template file header.php and add the following lines:

<?php if ( is_single() ): ?>
  <meta property="og:title" content="<?php wp_title('',true, 'right'); ?>"/>
  <meta property="og:type" content="article"/>
  <meta property="og:url" content="<?php the_permalink();?>"/>
<?php else : ?>
  <meta property="og:title" content="Al Binns' Web Stuff"/>
  <meta property="og:type" content="blog"/>
  <meta property="og:url" content="http://www.albinns.com"/>
  <meta property="og:description"
          content="Welcome to the personal blog of Al Binns. This blog is my 
                   playground on all things web related. The views expressed 
                   here are soley mine and do not represent the views of my 
                   employer."/>
<?php endif; ?>
<meta property="og:image" content="<?php bloginfo('template_directory'); ?>/images/fb-image.png"/>
<meta property="fb:admins" content="685696835"/>
<meta property="og:site_name" content="Al Binns' Web Stuff"/>

Adding this meta data and then clicking the “Like” button adds the following entry to my likes JSON Object, my blog is now in there:

{
   "data": [
...
      {
         "name": "Al Binns' Web Stuff",
         "category": "Personal blog",
         "id": "138016126225295"
      },
...
   ]
}

I now had the information I was looking for and a whole lot more as well. Using the Open Graph in this way also created a page on Facebook for my site with all the bells and whistles that go with it. My site is effectively part of the Facebook eco-system, check out the page here: http://www.facebook.com/pages/Al-Binns-Web-Stuff/138016126225295

This brings me back to the importance Facebook is placing on the Open Graph. Not only are they mapping multitudes of objects and their relationships from the real world they are also changing the way some of their internal functions work to reflect this. I noticed today that if you go into your profile and had previously entered certain profile information – education and work experience for example – the information was no longer valid. They now map things like this based on pages on the site, which in turn are all objects in the Open Graph. To fundamentally change how the profile system works for 400 million people shows how much weight Facebook are throwing behind the Open Graph and I suspect they have only just begun tapping the potential of this.

The good things is that it is based on an open system and is not proprietry, as other systems also embrace this the possibilities are staggering. As for how I’ll be using it we will have to wait and see. Currently my graph is small but you can change this by liking my stuff!

It’s F8 Dude

Following on from last weeks round up from Chirp is this weeks round up from F8 Facebook’s equivalent conference which took place this week. Just like Twitter, Facebook had a number of interesting announcements for developers, here’s a quick summary. Also not to be outdone by Twitter I’ve also taken a closer look at one of the announcements and intergrated it into my blog, more on that later.

Open Graph Protocol

Facebook’s Open Graph protocol allows you to easily integrate your site into the social space. Your web page like many out there can easily be classified as a type. Using these types Facebook aims to establish connections between you, your friends and these types. The example they have used is IMDb and how by specially marking up the pages to help describe them in terms of objects (in this case of the movie type), their users can then associate themselves with the page. This is achieved through a “like” mechanism which basically says “hey I like this movie”. This information will be able to be used in any number of ways – instant recommendation engines from people you trust!

Right now there is a limited set of object types but even if your site doesn’t have content which falls into one of these types you can always default back to the type “website” which effectively any page can be part of.

Graph API

Alongside the Open Graph is a Graph API to let you tap into this data. It will allow you to both read and write data into and out of Facebook. This is rather significant as previously Facebook has been a bit of a walled garden, all data contained within it was not accessible. This changed a bit with the use of Facebook Connect, this has now been pushed even further with an API to access this data. As all data is connected to each other and back to you it provides with a potentially very powerful tool. For example if you wanted to find out the films your friends like Facebook will give you an opportunity to do this.

oAuth 2.0

Privacy of course is a hot topic where Facebook is concerned. People should not be able to access all this data by default. When FB added Facebook Connect as a way of accessing Facebook on your own websites this was a proprietry system, and in my experience not an easy one to implement. At F8 Facebook announced it will be using oAuth 2.0 to replace FB connect. This allows people to autheticate your applications against Facebook giving the user control as to whether you can access the data you are feeding into Facebook. oAuth 2.0 is an excellent protocol and very easy to use. It should simplify using Facebook Connect considerably.

Social Plugins

Not the last thing at the conference by any means but the last thing I want to mention are the Social Plugins. These are a number of plug-ins which allow you direct access to public information directly on your website. The important point here, for any privacy zealots out there, is that this is public information, you have full control over your data in Facebook, OK the default is public but my mantra is usually if you don’t want things on the web don’t put them there, especially in the hands of a third party company.

These plug-ins are quite frankly excellent, they will give users instant personalisation on a website, allow you to quickly add information to your profile (or social graph) and will be ubiquitous across the web in weeks, if not days. I’ve used the “Like Button” plug-in both on the Homepage of this blog and at the bottom of each individual post. Configuring the plug-in was as simple as chaging a few options and cutting and pasting the resultant code into my blog template.

Summary

Overall I think Facebook have made huge strides in opening up their data. Don’t get me wrong they’ve done it for their own selfish reasons but the Social Graph will be one of the next big things and 400 (500?) million users will makes its adoption a hell of a lot quicker than starting from scratch. I’m interested to see what comes out of this over the coming months, mashups a plenty! No doubt we’ll get to work hands on with all these new tools in the near future.

HipHop for PHP

A break away from styling my site theming my site to blog about quite an exciting development announced yesterday by Facebook, a new opensource project called HipHop for PHP. My preferred language of choice for the past 8 or 9 years has been PHP, I started my commercial education with Perl but quickly migrated to PHP mainly because of its close ties with MySQL at the time. For the language zealots out there PHP is an oft derided language but you can’t deny its popularity and many of the reasons Facebook have cited in their use of PHP hold true for my tech team at Five by Five. But one complaint – PHP doesn’t scale – simply won’t go away, I guess this is largely because PHP is pretty CPU/memory intensive to run. Well HipHop for PHP will supposedly go some way to help this.

Facebook serves up an astonishingly large number of pageviews (4 Billion per month has been cited), and they use PHP. I’d say they’ve managed to scale it, of course its not really that simple, there’s lots of components to the Facebook stack but to do what they’ve done serves as a pretty good benchmark for PHP. Now it looks like they’ve gone one step further, they’ve taken the advantages of using PHP and without sacrificing them have improved the efficiency of serving up the site to improve the scalability.

In a nutshell, or as far as I can gather, HipHop for PHP takes the native code written as per usual in plain PHP and transforms it into C++ which is then compiled to be run. I won’t go into the technical details in this post but suffice to say for Facebook this Voodoo magic works and its now in their production environment on 90% of there servers, gaining them upto around 50% less CPU usage, in theory it means they won’t have to scale their hardware for a while.

What does it mean to the average coder. Well in my opinion not a lot, the vast majority of sites built don’t have the scalability issues that Facebook have. The paltry number of hits my blog receives for instance wouldn’t benefit from using HipHop and to be honest adding a compile step into my deployment process would probably slow me down, its a bit too much like Java for my liking. It does however give a viable option if I do need to scale my site without having to move to a multiple server architecture which is expensive. Of course there are still a myriad of other options to consider first, agressive caching, code optimisations etc but HipHop for PHP adds another option and another argument against the PHP doesn’t scale mob.

I guess it means that if you can code PHP you can code C++… or then again maybe not.