O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Consoles

Problem

It can be a real pain to set up a testing framework as a Facebook app if you just want to try out a few lines of API code. Surely there must be a better way!

Solution

Facebook makes three test consoles available to developers:

API Test Console

Found at http://developers.facebook.com/tools.php?api, the API Test Console lets you pick an API call from a drop-down menu, specify any optional parameters, and see the returned XML for your logged-in user. It’s very useful for figuring out what you’ll get back from a given call so that you can write code to handle it. There isn’t an FQL-specific Test Console, but you will find an fql.query option in the Method drop-down here.

FBML Test Console

Found at http://developers.facebook.com/tools.php?fbml, the FBML Test Console lets you choose where your FBML will occur (narrow profile box, wide profile box, canvas, email, notification, request, feed title, feed body, and mobile) and lets you enter some FBML that will be rendered from the logged-in user’s perspective (and shown in HTML source form).

Feed Preview Console

Found at http://developers.facebook.com/tools.php?feed, the Feed Preview Console is a really quick way to preview what a given story will look like in a user’s News and Mini-Feeds. This is critical to making sure your feed items will make effective use of the social graph, so spend time in here tweaking to get them right.

Discussion

All three consoles use the Facebook session from your browser, so they’ll work from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required