Package com.restfb

Examples of com.restfb.DefaultFacebookClient


public class PostWithTotalCountITCase extends RestFbIntegrationTestBase {

  @Test
  public void checkPostWithCommentsAndLikes() {
    DefaultFacebookClient client = new DefaultFacebookClient(getAccessToken(), Version.VERSION_2_1);
    Post gotPost =
        client.fetchObject("74133697733_10152424266332734", Post.class,
          Parameter.with("fields", "from,to,likes.summary(true),comments.summary(true)"));
    assertNotNull(gotPost);
    assertTrue(gotPost.getLikesCount() > 0);
    assertTrue(gotPost.getLikes().getCount() > 0);
    assertEquals(gotPost.getLikesCount(), gotPost.getLikes().getCount());
View Full Code Here


public class PostSearchITCase extends RestFbIntegrationTestBase {

  @Test
  public void tesPostSearchV1_0() {
    DefaultFacebookClient facebookClient = new DefaultFacebookClient(getAccessToken(), Version.VERSION_1_0);
    Connection publicSearch =
        facebookClient.fetchConnection("search", Post.class, Parameter.with("q", "watermelon"),
          Parameter.with("type", "post"));

    assertNotNull(((Post) publicSearch.getData().get(0)).getMessage());
  }
View Full Code Here

    assertNotNull(((Post) publicSearch.getData().get(0)).getMessage());
  }

  @Test(expected = FacebookOAuthException.class)
  public void tesPostSearchV2_0() {
    DefaultFacebookClient facebookClient = new DefaultFacebookClient(getAccessToken(), Version.VERSION_2_0);
    Connection publicSearch =
        facebookClient.fetchConnection("search", Post.class, Parameter.with("q", "watermelon"),
          Parameter.with("type", "post"));

    fail("facebook should not allow this public search");
  }
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

    new GraphPublisherExample(args[0]).runEverything();
  }

  GraphPublisherExample(String accessToken) {
    facebookClient = new DefaultFacebookClient(accessToken);
  }
View Full Code Here

    new GraphReaderExample(args[0]).runEverything();
  }

  GraphReaderExample(String accessToken) {
    facebookClient = new DefaultFacebookClient(accessToken);
  }
View Full Code Here

   * Default constructor.
   *
   * @param accessToken access token
   */
  public FacebookRESTClient(String accessToken) {
    this.readFBClient = new DefaultFacebookClient(accessToken);
  }
View Full Code Here

    private volatile Date lastQueryTime = new Date();
    //private volatile Date lastQueryTime =    parseDate("2013-11-08T19:33:20-0800");


    public FacebookFeedItemProvider(String authToken, String queryString) {
        facebookClient = new DefaultFacebookClient(authToken);
        this.queryString = queryString;
    }
View Full Code Here

  private ScriptusConfig config;

  @Override
  public void setCredentials(TransportAccessToken token) {
     
      facebookClient = new DefaultFacebookClient(token.getAccessToken());

  }
View Full Code Here

TOP

Related Classes of com.restfb.DefaultFacebookClient

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.