My name is Myles Noton, I am a Web Developer / Designer & Photographer based in London

There has been lots of hubbub about Facebook’s new OpenGraph protocol over the last few weeks, and as one might expect, the privacy advocates jumped on Facebook as soon as it was announced. However from a developers perspective, the OpenGraph API is great (despite the lack of documentation).

They have a point however, the privacy settings in Facebook are very confusing and convoluted, if you don’t know where to look or what to look for it is almost impossible to know what data is being shared, let alone lock it down. The average user wouldn’t know where to start, putting all the settings on one page would be a step in the right direction, instead of scattering them all around the place.

And of course, the issue of the “default” is a very important one, people that didn’t change the default settings should never have been made public simply due to lack of knowledge. An open profile should be opt in, not opt out.

One of the key things that many articles and comments I’ve seen about the new protocol is that the “Instant Personalisation” feature (which is on by default) is the worst thing since the last bad thing Facebook did. What many of them forget to mention is that these sites can only access your public information – that is, the information that is set to “Everyone” in your Facebook Privacy Settings.

Recommendations to turn off the Instant Personalisation feature doesn’t really solve the wider issue – turn it off and you stop a handful of sites from accessing your information, but leave millions of other applications and sites to access the same information freely, or put another way you’re stopping the fountain but leaving the waterfall.

But as worrying as the privacy concerns are – it pales in comparison to stories like the one posted on AllFacebook today titled Facebook Knows That Your Relationship Will End In A Week. The data described in the article wasn’t sourced from the OpenGraph API, nor is it anything to do with external developers or companies – it is from the data that Facebook collects internally.

“As the service’s engineers built more and more tools that could uncover such insights, Zuckerberg sometimes amused himself by conducting experiments. For instance, he concluded that by examining friend relationships and communications patterns he could determine with about 33 percent accuracy who a user was going to be in a relationship with a week from now. To deduce this he studied who was looking which profiles, who your friends were friends with, and who was newly single, among other indicators.” The Facebook Effect, Kirkpatrick.

The bigger discussion here is whether people should be posting so much personal information on Facebook in the first place, sure it’s good to chat to your friends, share photos, but do you really need to put your home address? Phone number? And if you do, are you really that worried about your privacy? With the level of data warehousing and data mining described in the article, the issue of public vs private isn’t just about what the API allows developers to do, it’s also about what the terms and conditions say Facebook are allowed to do and as more and more people post ever increasing amounts of personal information the less privacy there will be, But no one is being forced to join or share the information, one of the main problems is telling users when to stop sharing.

This post has been tagged: ,

Since Facebook’s announcement of the Open Graph Protocol and Graph API at the f8 conference a few weeks ago it has been time to re-read the Facebook Documentation and try to work out how the new API’s fit into a few personal and work projects.

As part of that research I decided to fill a void in my development time – I’m forever trying to find the Facebook User ID of the user I am currently logged in as – and it doesn’t help when you have 10+ testing accounts, plus my own personal account.

So I threw together this:

Myfbid.com allows you to login (Using the Facebook OpenGraph API) and it will immediately show you your current Facebook User ID, you can logout and login again with a different account and it will do the same for that one.

No personal data is collected or stored during the process – it simply looks up your User ID and shows it on the page.

Over time I will add some more features, the ability to see your Friends User ID’s perhaps and some other cool things that will help developers.

Hope some people find it useful!

This post has been tagged: , ,

Lloyd brought up a few good points in his response to my previous post titled Life after Graduation, so I thought I would take this opportunity to discuss it in more detail.

Social Media is nothing new, but it’s something that has grown exponentially in the last few years, it’s hard to walk down the street today without seeing some form of Social Media at work, even large news corporations are starting to use Social Media (rightly or wrongly) as a conduit for gathering news worthy stories.

Almost everyone now has a Facebook account, well not everyone, there are only 350 million Facebook accounts and many billions of people on the planet – but chances are most if not all of the people in your group of friends and family will have one. Social Media isn’t just about having an account though, it’s about how you use it.

For recent graduates Social Media can be a very powerful tool to increase your exposure and employability. The technology industry is an extremely fast moving and competitive place, and as everyone says, the more employable you can make yourself, the more chance you have of getting a job.

This is where Social Media comes in, how better to show employers that you are passionate about the industry and show off your talents than taking advantage of some of the most popular tools on the web?

The main goal of all of this is to create a brand for yourself, when someone searches your name in Google you actually want them to find something, your blog, your twitter account, your LinkedIn account, and the content that lives there go towards helping you get your name out there, and gets you associated with the industry.

Blog

Blogs have also been around for years, but I’m surprised how many of my fellow Computer Science graduates don’t even have one! It’s is one of the first things you need to do in order to get your name out there.

Think of something you’re interested in or find interesting about the industry and create a blog about it, use it to share interested things you’ve found on the subject, or add your own opinion to commonly discussed topics.

Use your blog as an avenue to show off some of the work you have done, if you’ve a designer, show off your designs, if you’ve written a cool piece of code, share it, it all helps a potential employer get an idea of the work you are capable of and how passionate you are about the area.

Twitter

Twitter is a fantastic tool to help you drive traffic to your blog and to share interesting links with your followers. While Twitter isn’t going to be able to get you a job, using it will get you more exposure, and at the end of the day that’s what you need to do, get more people to see your work and skills.

Facebook

For most people Facebook is a walled garden, I personally prefer to have my privacy settings as high as they go, but that doesn’t mean that Facebook doesn’t play a key part in using Social Networking effectively. Recently Facebook has opened up many of the News Stream features to behave much like Twitter, meaning that it’s another way to get your name out there.

LinkedIn

If your goal is to use Social Media to get yourself a Job outright then LinkedIn is probably the most important place to start. LinkedIn is a bit like using monster.com except it focuses more on the business relationships you have made – but it doubles as very useful job hunting tool. Fill out as much your profile as you can, take things from your CV and try to sell yourself. From there you can go to the Linkedin Jobs section and apply for some in the same way as you do on monster.com.

To get the most out of LinkedIn I would recommend searching the Groups Directory for groups in the field you want to pursue and join as many as you can. A while ago I joined a PHP Developer group and ever since then I’ve got quite a few recruitment consultants contact me, so it does work!

Having said all this Social Media isn’t just a way to promote yourself, it’s a chance to learn from influential people in the industry, stay up to date on what’s going on and learn new skills.

This post has been tagged: , ,

I’ve been doing Facebook development for a while. In the beginning I found myself searching around for answers, this post is aimed at people like me who are searching for some helpful tips on Facebook Application Development. This post deals with some technical and non-technical aspects of Facebook Development that I came across and is by no means exhaustive.

If you’re looking for speed, then you’re going to be very disappointed, the Facebook API certainly isn’t the fastest thing on the planet – it doesn’t take many API calls to get the page to load in 4+ seconds, added to that any additional overhead and you can quite easily hit the 8 – 9 second timeout limit. To try and overcome this I have a few tips that have helped me speed up the process a little:

1. Less is more!

The old saying is true, sometimes the less you do something, the better it is. The same goes for the Facebook API – the more you make API calls the slower the page will be.

Some of the common causes that I have found is calling the API inside a loop, not only does this have the potential to create hundreds of requests, but it also will cause a noticeable performance hit, so looping through a user’s 350 friends to get their names isn’t the best way to get things done.

If at all possible try and limit the number of API calls per page, there are usually FBML tags that do things a lot faster than calling methods on the API.

2. Batch API Calls

For situations where many API calls are unavoidable, try using the Batch API. By doing this you will save quite a lot of overhead by requesting all the data in one large chunk, and not in multiple little pieces that take longer because of the time taken to transfer the data. Depending on the usage you will see a relatively big performance increase by using this method.

$facebook->api_client->begin_batch();
$friends = & $api_client->friends_get();
$notifications = & $api_client->notifications_get();

$facebook->api_client->end_batch();

3. Cache

While you aren’t allowed to store a user’s data forever you are allowed to store it for up to 24 hours. In addition to this there is some data that you are allowed to store, for a full list take a look at the Storable Data documentation. One of the biggest things is to decide if any of the allowed storable entities would save you an API call or two, and then see if replicating some of the data in your own databases would lead to better performance.

4. Quick Transitions

For me this was perhaps the most noticeable performance boost of them all, and it was only be chance that I discovered it. To see for yourself:

  1. Go into the Developer App
  2. Go to your application settings
  3. Click on the canvas tab
  4. At the bottom there is an option called “Quick Transitions” – turn it on.

5. General Optimisations

I maybe stating the obvious but it’s worth saying just in case.

All the optimisations above will help speed up your application, but the most important thing to do is to make sure ALL your code is as optimised as it can be, not only PHP, but also the markup and CSS, theres no point in making the API calls as efficient as possible if the app is just going to sit there for a few seconds while it decides what to do with it.

There’s not much I can really say about how and what to optimise, but I did find the following code useful to check the page execution times:

$start = microtime(true);

// Do stuff in here

$end = microtime(true);
$time = $end - $start;
echo "Done in $time seconds";

Use this code to test the execution time of the page or a certain function or method call.

Conclusion

Happy Performance Tuning!

This post has been tagged: ,

With so many of us now using “Cloud” services to share and store data, one of the key things to remember is that just because it’s in the Cloud, it’s not always guaranteed to be safe. I’m not talking about the security implications of using cloud services as much as I am the possibility of the service disappearing or a massive data loss down the line that makes it almost impossible to get your data back – something that is even more important since the T-Mobile / Microsoft Sidekick fiasco a while back.< ‘p>

When using services like Facebook, Flickr and Twitter it can be a nightmare to get to your data, you may find individual applications that do it, but it can be a laborious task.

This is where Backupify comes in, Backupify is an easy way to backup all the popular cloud services in one place using the API’s provided by each service, simply sign up, configure the backups and Backupify will do the rest for you – all from one central location.

I was first introduced to Backupify on Net@Night where the founder Robert May was interviewed. After listening, I signed up for an account and set it up to backup Flickr, Twitter, Facebook, Blog and Gmail account, the process was surprisingly easy, some of the services require you to login and authorise the Backupify service, others require you to enter your user name and password, but I had it all set-up within about 5 minutes.

The best part about Backupify is that until the 31st January 2010 you can sign up for a FREE account, after this time there will still be a free account but it will have limitations unless you pay for a premium account. Personally I recommend signing up now and setting it up – just in case!

This post has been tagged: ,

I’ve been doing Facebook development for a while now. In the beginning I found myself searching around for answers, this post is aimed at people like me who are searching for some helpful tips on Facebook Application Development. This post deals with some technical and non-technical aspects of Facebook Development that I came across and is by no means exhaustive.

1. Plan Ahead

Like all web applications, the first place to start is the drawing board. This will not only allow you to work out what is needed, but it also helps you make the choice between using FBML Canvas or an Iframe not to mention getting everything into perspective before you start. There’s nothing more annoying than getting half way through an implementation and realising some of what you’ve done needs changing.

Part of the planning should include (despite how boring it sounds) reading the Platform Guidelines which now also include an Example and Explanations section detailing some of the policies for the most important Facebook Platform features – not only will this help you deliver a good experience to your users but it could save you a lot of problems further down the line.

In addition to the Platform Guidelines I would also advise reading the Storable Data documentation to see what kind of user data you are allowed to store, as this will have a significant effect on what your app might be able to do.

2. Canvas or Iframe?

The answer to this question depends on what you want your app to do.

If your app will rely heavily on the Facebook API & FBML features then a Canvas page is almost certainly your best option, on the other hand if you simply want to take some content from an existing site and display it in Facebook with minimal API interaction then an Iframe would probably be an easier option, of course these are vast generalisations so give it some thought before you code against one or the other.

A good document to read to help you decide is the Choosing between an FBML or IFrame Application page in the developer documentation.

3. Dealing with external files

Ok, so you’ve chosen to use the canvas for your application. Now you want to start by including an external stylesheet, but wait, you can’t get it to work… now what?

Because Facebook canvas pages are parsed by Facebook before they are displayed they don’t need head tags (since there’s already a valid HTML structure), this means that including stylesheets can be tricky. The best way is to use PHP to read the stylesheet and output it into the page upon each request, a poor man’s include if you will. To do this you have to use the file_get_contents() function in PHP like this:

file_get_contents('http://www.somewhere.com/style.css')

Of course you could just do everything on the page, which is fine for a single page app, but not if you’re going to have more!

4. Create a Landing Page

Originally part of the Application Verification process was the requirement that users are not met with the “Application Add” dialogue as soon as they go to the canvas URL, now since the Verification process has now been scrapped and all applications are held to this it’s a good idea to do it anyway, even if it’s just to improve the user experience.

The best way that I have found to accomplish this is to check to see if the Facebook user ID is set on every page and then send the user to a permissions page if it is not. Because of this you can no longer use the Facebook::require_login(); method as this will automatically display the “Application Allow” dialogue, instead I use:

$this->_user_id = $facebook->api_client->get_loggedin_user();

if(!isset($this->_user_id)){
$facebook->api_client->redirect("http://apps.facebook.com/appname/permission/");
}

This allows your application to send the user to a landing page with a nice graphic and an explanation of the application before they have to add it.

5. Publish to the News Stream

One of the most powerful tools at a Facebook developer’s disposal is the News Feed – the constant stream of updates that the user gets about their social graph. Not only does it give you the chance to drive traffic to your application but it also provides a useful communication tool.

Publishing to the Stream couldn’t be easier:

$message = "Hello World! This is a test of the Publish.Stream Method";
$facebook->api_client->publish_stream($message);

Be aware that the Publish.Stream method requires that the user accept the publish_stream permission as described in the Extended Permissions documentation.

6. Use the Multiple Friend Selector

Get your users to invite their friends by using the <fb:multi-friend-selector> FBML tag, the message you send to the users friends is completely customisable and you can even add an email invite box underneath. You can get the full list if parameters and options by reading the Fb:multi-friend-selector documentation.

Using this feature will allow you to tap into the users friends and increase your user base, if a user likes your application they will invite their friends. To encourage more users to do this try and build in more ‘social’ aspects, make their friends a part of the main focus of the application.

7. Use the API Redirect Method

It is sometimes useful to redirect a user to another page depending on certain criteria or after a certain action, one would normally just use the header();PHP function, but this isn’t possible when making an app for Facebook.

To make this happen take a look at the Facebook::redirect() method if your using the PHP library or the <fb:redirect> FBML tag if you’re not.

8. Testing Testing Testing

Before you release your app make sure you test everything over and over again. It’s not good enough to just test it with one user though, create multiple Facebook user accounts, test the app from end to end, from adding the app to removal, everything needs to be tested!

Make sure you read the Facebook Test Accounts documentation to make sure that Facebook doesn’t delete your accounts, this involves adding the users to the “Facebook Testing Account Network” to identify test accounts from real ones.

Also remember to test in multiple browsers, if you’ve used CSS or any FBJS then it’s important that your users get a consistent experience no matter what browser they use – and since Facebook also supports IE6, it’s probably going to be beneficial for you to as well, no matter how painful the process is!

If you’re using Windows you can use the Microsoft IE Virtual PC images to test your application in IE6 and 7, or you can use the free Microsoft Expression Web SuperPreview for Internet Explorer tool to do the same thing.

9. It seems a little slow, any ideas?

One thing you will need to learn is that Facebook is almost always never fast, at least not loading pages.

There are a few things that I have done to help speed things up. The first is to reduce the amount of API calls made by the application, that way you won’t need to wait as long for the API to send you data before you can load the page. Another way is to add some kind of caching, this could either be done in session or in a database.

One of the first things I do however is enable the “Quick Transitions” option in the Application Canvas settings of the Developer App, this speeds up the page loading time significantly as it doesn’t reload the Facebook frame on every page load – this could cause issues somewhere along the line however I have yet to see any side effects of using this option.

10. It’s launched, now how do I add new features?

Oh the memories, needless to say I’ve been burned by this before, first things first – NEVER develop on the live app, you will break things and your users will get annoyed and go away (I’m sure you know this already).

My advice is to create a separate Facebook Application with separate API Keys that points to a completely separate copy of the code so you can break as much as you want without annoying anyone.

Conclusion

This post should give you a bit more information about Facebook Application Development, but it is by no means an a-z guide, as with almost everything, the best thing to do is to go and give it a go yourself!

This post has been tagged: ,