Package com.restfb

Examples of com.restfb.FacebookClient


      return null;
    }
  }
 
  public List<FacebookUser> getFriends(String accessToken) throws FacebookOAuthException {
    FacebookClient fb = createFacebookClient(accessToken);
    return fb.executeFqlQuery(FRIENDS_FQL, FacebookUser.class);
  }
View Full Code Here


    FacebookClient fb = createFacebookClient(accessToken);
    return fb.executeFqlQuery(FRIENDS_FQL, FacebookUser.class);
  }
 
  public List<FacebookUser> getAppFriends(String accessToken) throws FacebookOAuthException {
    FacebookClient fb = createFacebookClient(accessToken);
    return fb.executeFqlQuery(APP_FRIENDS_FQL, FacebookUser.class);
  }
View Full Code Here

    FacebookClient fb = createFacebookClient(accessToken);
    return fb.executeFqlQuery(APP_FRIENDS_FQL, FacebookUser.class);
  }
 
  public List<String> getAppFriendsIds(String accessToken) throws FacebookOAuthException {
    FacebookClient fb = createFacebookClient(accessToken);
    List<FacebookUser> facebookUsers = fb.executeFqlQuery(APP_FRIENDS_IDS_FQL, FacebookUser.class);
    return Lists.transform(facebookUsers, new PropertyFunction<FacebookUser, String>("facebookId"));
  }
View Full Code Here

  public void publish(String accessToken, String message) {
    publish(accessToken, FB_ME, message);
  }
 
  public void publish(String accessToken, String facebookId, String message) {
    FacebookClient fb = createFacebookClient(accessToken);
    fb.publish(facebookId + FB_FEED, FacebookType.class, Parameter.with(FB_MESSAGE, message));
  }
View Full Code Here

    publishLink(accessToken, FB_ME, link, message, image, caption, description);
  }
 
  public void publishLink(String accessToken, String facebookId, String link, String message, String image,
      String caption, String description) {
    FacebookClient fb = createFacebookClient(accessToken);
    fb.publish(facebookId + FB_FEED, FacebookType.class, Parameter.with(FB_LINK, link),
      Parameter.with(FB_MESSAGE, message), Parameter.with(FB_PICTURE, image),
      Parameter.with(FB_CAPTION, caption), Parameter.with(FB_DESC, description));
  }
View Full Code Here

    @Path("/login")
    public Response facebookLogin(@QueryParam("access_token") String access_token) {
        String appId = env.get("facebook.appId");
        String appSecret = env.get("facebook.appSecret");
        try {
            FacebookClient facebookClient = new DefaultFacebookClient(access_token);
            User user = facebookClient.fetchObject("me", User.class);

            String me = "";
            try {
                me = gson.toJson(user);
            } catch (Exception e) {
View Full Code Here

    // You'll want to initialize the bridge just once at app startup.
    // In a webapp, a good place to do this is ContextLoaderListener#contextInitialized()
    SLF4JBridgeHandler.install();

    try {
      FacebookClient facebookClient = new DefaultFacebookClient();

      // You'll notice that logging statements from this call are bridged from java.util.logging to Log4j
      User user = facebookClient.fetchObject("btaylor", User.class);

      // ...and of course this goes straight to Log4j
      logger.debug(user);
    } finally {
      // Make sure to tear down when you're done using the bridge
View Full Code Here

TOP

Related Classes of com.restfb.FacebookClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.