Under the hood: how your friends might have updated their status via “mobile devices”
Recently I noticed a friend keeps on updating his status which appears to be coming from the most trendy mobile devices on the market right now.
He could have borrowed his friend’s devices though, but since he is watching the World Cup alone I guessed there was something abnormal about it, so I decided to look for some sort of application that allow you to change your status with those neat little “via Facebook for iPhone”, “via Facebook for Blackberry” etc.
I found this
It worked and I was able to get those appealing statuses, but what bothered me is, this seems all too simple, it seems to utilize some sort of Facebook API but previously, when I referenced the Facebook wiki for Stream writing and link posting, I found no parameters that would allow you to edit the “via…”. And the site above didn’t show how it did that, so I decided to dig in. Time for Ctrl+U (view source).
That seemed simple, it’s just a bunch of iframes referencing to some sort of Facebook’s live-chat like service. It does say “event” so I tried to create an event but found no options to create such a widget. I tried to search for Facebook connect instead and found this post.
Step 1 – Create the App in Facebook
First things first. Go here to create the App in Facebook: http://www.facebook.com/developers/createapp.php. Give it a name:
Then, add all the necessary info that you can, including logos, icons, user-facing URLs, etc on the “Basic” tab:
You technically don’t have to fill out really anything except this next part.
Go to the “Connect” Tab on the left and fill out this important information there:
Make sure you get this right!
And that’s it! Make sure you write down (or copy) your Application ID, as you’ll need that next:
Step 2 – Create the iFrame, Style, and Finish!
Honestly, most of the hard work is done already!
All you have to do is copy some iFrame code into your template or website with the Application ID, adjust some of the width/height to fit correctly, and you’re done!
As you can see, I’m adding the code to the bottom of the page, just above the Footer. I’ve added a “fbc” <div> class to styling to make sure it’s centered correctly, etc.
You don’t have to do any of this, of course, and most people won’t have to do anything with CSS styling.
And here’s what the code looks like in my footer.php file (I’m using WordPress to power this site).
As you can see, I’ve adjusted the width to be 983 pixels wide (matching my div class) and the height is 500 pixels.
You can, of course, change all of this to whatever you’d like! The only important part for you to change is the “app_id” value, which is currently set to 94203137849, which is my application ID.
You don’t need the <div> like that post instructed, it’s just for styling, what you really need is the url inside the <iframe>.
It involves creating a Facebook application, which has evolved since the last time I touched it (to create a voting application). It doesn’t even require you to write a single line of FBML like before, but just point-and-click. The trick leverages the fact that the Facebook applications for devices utilize the same framework, and hence by making your own application, you con edit its name to modify the “via…” part to anything you’d like. Here, I made an application with the name “iPhone 4”. Click here to try it.
Buying an iPad is not the only way to impress your folks ;))