I got this code can you help me?
can you fix this for me so i get user's name and email
thanks
package facebooktest1;
import com.restfb.*;
import com.restfb.exception.*;
import com.restfb.json.*;
import com.restfb.types.*;
import com.restfb.util.*;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public class Main {
String API_KEY = "d33e82abxxxxxxxxxxxxxxxxxxxxxxx";
String SECRET = "62dd6c73xxxxxxxxxxxxxxxxxxxxxxx";
static FacebookClient facebookClient;
String facebookAuthToken = null;
String facebookSessionKey = null;
public static void main(String[] args) {
facebookClient = new DefaultFacebookClient("2227470xxx|
2.PnVz9uj4blyh4iR_bGss4Q__.3600.1297386000-561331950|bNfq-
xK8_Dyt2Ck1SY-g2xxxxxx");
// I always call facebookAuthorise
// First time users would click a button that calls
facebookConnect() first to grab the session key.
facebookAuthorise();
}
private void facebookConnect() throws FacebookException {
// auth.createToken returns a string
//
http://wiki.developers.facebook.com/index.php/Auth.createToken
facebookAuthToken = facebookClient.execute("auth.createToken",
String.class);
//facebookAuthToken =
facebookClient.executeQuery("auth.createToken", String.class);
String url = "
http://www.facebook.com/login.php"
+ "?api_key=" + API_KEY
+ "&fbconnect=true" + "&v=1.0"
+ "&connect_display=page" + "&session_key_only=true"
+
"&req_perms=read_stream,publish_stream,offline_access"
+ "&auth_token=" + facebookAuthToken;
// Here we launch a browser with the above URL so the user can
login to Facebook, grant our requested permissions and send our token
for pickup later
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {
try {
desktop.browse(new URI(url));
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (URISyntaxException use) {
use.printStackTrace();
}
}
}
}
private static void facebookAuthorise() throws FacebookException {
// I saved my session key to a .properties file for future use
so the user doesn't keep have to authorising my app!
// auth.getSession returns JSON so we need to decode it just
to grab the session key
//
http://wiki.developers.facebook.com/index.php/Auth.getSession
// Here we pickup the session key and define the authToken we
used above in facebookConnect()
JsonObject json = new
JsonObject(facebookClient.executeQuery("auth.getSession",
String.class, Parameter.with("auth_token", facebookAuthToken)));
facebookSessionKey = json.getString("session_key");
// An example call, you can literally use anything from the
REST API
Long uid =
facebookClient.executeQuery("users.getLoggedInUser",
facebookSessionKey, Long.class);
System.out.println("FB User ID: " + uid);
}
}