Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. Page page = facebookClient.fetchObject("lockheedmartin", Page.class);
  2. System.out.println(page.getIsVerified());
  3. System.out.println("bio: "+page.getCategory());
  4. int totalResults = 0;
  5. Connection<Post> pageFeed = facebookClient.fetchConnection(page.getId() + "/feed", Post.class,Parameter.with("limit", 20));
  6. for (List<Post> feed : pageFeed) {
  7. totalResults = totalResults + feed.size();
  8. for (Post post : feed) {
  9. com.restfb.types.Post.Comments comments = post.getComments();
  10. if(comments !=null){
  11. List<Comment> commentList = comments.getData();
  12. for(Comment comment : commentList){
  13. System.out.println(comment.getMessage());
  14. }
  15. }
  16. }
  17. }
  18.  
  19. Page page = facebookClient.fetchObject("lockheedmartin", Page.class);
  20. int totalResults = 0;
  21. Connection<Post> pageFeed = facebookClient.fetchConnection(page.getId() + "/feed", Post.class,Parameter.with("limit", 20));
  22. for (List<Post> feed : pageFeed) {
  23. totalResults = totalResults + feed.size();
  24. for (Post post : feed) {
  25. Connection<Comment> comments = facebookClient.fetchConnection(post.getId()+ "/comments", Comment.class);
  26. if(comments !=null){
  27. List<Comment> commentList = comments.getData();
  28. for(Comment comment : commentList){
  29. System.out.println(comment.getMessage());
  30. }
  31. }
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement