Results 1 to 4 of 4

Thread: Which operations methods return likes? for games, sports, athletes, etc ???

  1. #1
    Join Date
    Sep 2007
    Posts
    138

    Default Which operations methods return likes? for games, sports, athletes, etc ???

    I'm trying to retrieve facebook user information such as games, favorite athletes, sports etc.

    In the graph api explorer they show up under "games" and the rest under "likes"

    However I'm not able to find what API call returns these things. I figured they would be found under LikeOperations but that doesn't seem to be the case.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    The "games" connection is relatively new to Facebook's Graph API and isn't covered by Spring Social Facebook's API binding yet. It does make the most sense to have it in LikeOperations. I've created https://jira.springsource.org/browse/SOCIALFB-35 to track this.

    As for favorite athletes, sports, etc...I see no such connection for those. They just fall under "likes" as you found out with the Graph API.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Sep 2007
    Posts
    138

    Default

    Quote Originally Posted by habuma View Post
    The "games" connection is relatively new to Facebook's Graph API and isn't covered by Spring Social Facebook's API binding yet. It does make the most sense to have it in LikeOperations. I've created https://jira.springsource.org/browse/SOCIALFB-35 to track this.
    Cool. Thanks

    Quote Originally Posted by habuma View Post
    As for favorite athletes, sports, etc...I see no such connection for those. They just fall under "likes" as you found out with the Graph API.
    But how do you retrieve these "likes" with SpringSocial? "likes" according to the API seems different - looks like it gets you users who have liked the object you provide instead of a list of the likes you'd see using the graph api:

    From the API docs:
    java.util.List<Reference> getLikes(java.lang.String objectId)
    Retrieves a list of references to users who have liked the specified object.

    Thanks again

  4. #4
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    The getLikes() method, as you pointed out, takes an Object ID and returns a list of users who have liked that object. To get the things that a user has liked, you should use getPagesLiked(). With no arguments, it gets a list of Page objects for the objects that the authenticated user has liked or you can pass in a user ID to get that user's likes.

    In case it's unclear, the reason it returns a list of Page objects is because ultimately almost every object on Facebook is represented by a Page. So, when you "like" a television show, restaurant, or whatever, you're really liking the page that represents that object.
    Craig Walls
    Spring Social Project Lead

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •