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 ...

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.