Wednesday, June 9, 2010

RestFB is a simple and flexible Facebook Graph API and Old REST API client written in Java.

clipped from restfb.com

RestFB


RestFB is a simple and flexible
Facebook Graph API and
Old REST API client written in Java.

FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN);
// For all API calls, you need to tell RestFB how to turn the JSON
// returned by Facebook into Java objects.  In this case, the data
// we get back should be mapped to the User and Page types, respectively.
// You can write your own types too!

User user = facebookClient.fetchObject("me", User.class);
Page page = facebookClient.fetchObject("cocacola", Page.class);

out.println("User name: " + user.getName());
out.println("Page fan count: " + page.getFanCount());

0 comments: