Announcement Announcement Module
No announcement yet.
Spring Social Facebook, STATUS message, post.getType().toString() return LINK Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Social Facebook, STATUS message, post.getType().toString() return LINK

    Not sure if I've stumbled across a defect or if I've misconfigured/misused something, I have some basic code that is retrieving facebook posts from the main feed. For some status messages the post.getType().toString() message returns LINK rather than STATUS, even though the underlying JSON says STATUS, here is some example code

    ObjectMapper mapper = new ObjectMapper();
    String originalPost = mapper.writeValueAsString(post);"FB item with...");"post.getType(): " + post.getType().toString());"post.getFrom()" + post.getFrom().getName());"json is: " + mapper.writeValueAsString(post));

    in the logs i see

    2011-08-25 10:37:47.280 post.getType(): LINK

    but when I inspect the JSON I see a status message...

    {"name":null,"message":null,"id":"1438884935_23080 48907541","type":"STATUS","description":null,"icon ":null,"link":null,"from":{"name":"xxxxxx","id":"1 438884935"},"createdTime":1314255056000,"updatedTi me":1314255056000,"comments":null,...

    Anyone else seeing something similar?

  • #2
    I just tried this against a couple of feeds with a nice mix of post types and getType() matched up perfectly with what was in the JSON. I'm wondering a few things:

    - Is this with the latest snapshots (or even RC2)? Or is it with some older version of Spring Social?
    - Where did you put the code above to get the logging?
    - Is there something unusual about the feed your testing this against? I only see a bit of the JSON here so it's hard to say.
    - And what you show here is curious to me because the "type" is "STATUS", when I know FB returns lowercase "status". And there are other oddities, such as null values and non-wellformed JSON. Is this really the JSON you got back from Facebook?