Due to the success of my Facebook application, and a growing number of emails from other webcomic owners asking for help making their own I have decided to release the files I used, and write a tutorial on how to make your own Facebook application.
Facebook is growing at an incredible rate, and it is very likely that a lot of your readers have Facebook profiles. Now you can offer them a way to get your comic delivered straight to their profile. The best bit is that their friends all get to see your comic on their profile; they can invite their friends to do the same. This application works by using your RSS feed – if you don’t have an RSS feed, or your comics don’t appear in your feed then this might not work out so great for you.
First Steps
This tutorial assumes you have basic PHP skills, very basic. In the sense that you know that PHP is, you know, a language or something. It also assumes that you have added the Developer Application, oh, and of course, you must have a Facebook account! You should also have some spare hosting space to store the application as Facebook require you to hose your own applications. Before creating your application make sure you have some hosting space. Download this zip, virus scan it first if you don’t trust me. Then feel relieved that I haven’t given you a virus. The zip includes the required from Facebook and a working version of the application – you will need to follow the rest of the tutorial for it to work though.
Setting up the application
Before we make the application, we must first register it with Facebook. This will give us an API Key and a secret which will enable our application to ‘talk’ to Facebook.
To do this go to the Developer App and click on the Set Up New Application link. Fill in the details, I’d use “Latest from yourcomicname” as the Application Name. The Callback URL is where you are hosting the application files, for example: “http://yoursite.com/Facebookapp/” (no quotes). Ensure that you have a trailing slash on your Callback URL otherwise the application won’t work. The Canvas Page URL is the address of your application, for which I’d use your comic’s name.
Make sure Use FBML and Website are selected, and that you answer yes to Can your application be added on Facebook? Fill in a brief explanation of what the application does – it gets the latest posts from your comic. The Post Add URL should be your Canvas Page URL. I’d leave Default FBML blank and select Wide for the Default Profile Box Column. Again, the Side Nav URL should be the Canvas Page URL.
Then Submit. This should give you an API Key and a Secret, which we will now use.
Now go back to the zip I asked you to download. Extract it so you can edit the files.
• In appinclude.php put in your API Key, Secret and Callback URL.
• In Canvaspage-template.php at around line 15, switch “your comic site” to, well, your comic site.
• In conf.php fill in your API Key and Secret and replace all instances of “yoursite.com” with… you guessed it, yoursite.com. Also, add the URL of your comic RSS feed.
• In invite.php, around line 17, change your comic to, your comic and change the url to that of your application.
• In links.php exchange the http://apps.Facebook.com/yourappURL/ for the address you choose for your Canvas Page URL.
• Edit title.php to what you want to appear at the top of your application.
Okay, that should be it. Upload your files to your host. Now it’s time to test the application. Add the application by clicking on “View About Page” and then add application. There is a developer mode you can set so that only you, and other developers of your app, can see the application once it’s added. This means you can play around with it on your profile and no one will know.
Once you’re happy with how everything is working you can submit your application to the product directory, meaning people can add your application directly from the directory. However, people are still able to add your application before hand; in fact, you will need five users to have added it before your application will be approved.
Using the Application
To update your comic simply visit your application when you have updated the site and the application will update for all users. This is dependant on your RSS feed, you can only update the application after your feed has been sent out, this can vary between site, ranging from a few minutes to an hour or two.
Afterwards
Building the application is all very well, but you have to tell people about it too. Even if you get accepted into the directory you may not get many adds, unless you are a hugely popular comic of course!
I would recommend writing a news post about the application, including a link to it in the post. Encourage people to add the app, and even ask them to invite their friends to do the same. But don’t make every post sounds like you are begging people to add the application, remember, Facebook profiles are people’s personal space – if they don’t want to see your comic there they just won’t add it. But here’s a tip – you can become a fan of an application without actually adding the application itself – you could encourage those that don’t want to full blown app to become a fan of it instead, showing their support in that way.
Support
This tutorial was really intended to give those in the web community an easy way into the world of Facebook applications, especially those people who either don’t have the technical knowledge to, or, the time to build an application from scratch. Hopefully you’ve found it useful. If you have run into trouble I’ll try my best to help, but being a university student I can’t promise immediate support, so if I don’t get around to solving your problem I do apologise. Please leave any support questions in the comments so that my inbox doesn’t get flooded and I’ll try to get back to you.
There is a link back to my site included in the application. It’s quite small and doesn’t appear on the profile page at all, just on the bottom of the canvas page. If you really want to delete it you can, it’s in canvas-rss.php file. If you’ve found this tutorial and sample application help, I’d love it if you could mention my comic when you tell your fans about your brand spanking new application, just as a way of saying thanks Or even an email with a link to your new application. That, or bid on my project wonderful adds, heh.
Best of luck with your comics,
Mike