package org.elephantt.javabook.client;
import net.sf.json.JSONObject;
public class Sample {
public static void main(String[] args) {
String apiKey = "534e5d4780fb2e3178513cf9067fa543"; // YOUR API KEY
String secret = "8954c71c87ac51826092c5e55857b67e"; // YOUR SECRET
// Just create one of these for your app/process
FacebookRpcClient fbRpcClient = new FacebookRpcClient(apiKey, secret);
// You just need one of these for your app, too
FacebookClient fbClient = new FacebookClient(fbRpcClient);
String authToken = ""; // an auth token you've received
// creates a session from the auth token
//FacebookSession session = fbClient.createSessionKeyForAuthToken(authToken);
//FacebookSessionClient fbSessionClient = new FacebookSessionClientImpl(App.getServer().getFacebookRpcClient(), session);
//JSONObject obj = fbSessionClient.queryForObject("select first_name from user where uid=" + session.getUid());
//String name = obj.getString("first_name");
}
}
|