Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a 'story' and a 'message' in the me/home JSON Reply

I'm building an app that takes status updates from several Social Media. Already have the Twitter one working like a charm. But now that I have to work with Facebook's Graph API, mysterious things keep popping up. Like the fact that a post contains either a message or a story (not both as far as I know). I haven't managed to find the difference between the two.

I figured it would probably have to do with the type of the post, but it doesn't I found out that the types link, status, photo and video can all contain either a message or a story. Then there's swf which i've only seen with a message.

Can anyone tell me what's the deal here? Is the real only difference that one is a real status update and the other just a 'like' or something similar?

Example JSON:

{
        "id" : "<<Some ID>>",
        "from" : {
            "name" : "<<A Friend>>",
            "id" : "<<Some ID>>"
        },
        "message" : "Maakt zich op voor ronde twee in de presentatiedienst bij #omropfryslan Zometeen tussen vier en zes live!",
        "icon" : "https://fbcdn-photos-a.akamaihd.net/photos-ak-snc7/v85006/23/<<Some ID>>/app_2_<<Some ID>>_7567.gif",
        "actions" : [{
                "name" : "Comment",
                "link" : "https://www.facebook.com/<<Some ID>>/posts/<<Some ID>>"
            }, {
                "name" : "Like",
                "link" : "https://www.facebook.com/<<Some ID>>/posts/<<Some ID>>"
            }, {
                "name" : "@<<A Friend>> on Twitter",
                "link" : "https://twitter.com/<<A Friend>>?utm_source=fb&utm_medium=fb&utm_campaign=<<A Friend>>&utm_content=<<Some ID>>"
            }
        ],
        "type" : "status",
        "application" : {
            "name" : "Twitter",
            "namespace" : "twitter",
            "id" : "<<Some ID>>"
        },
        "created_time" : "2012-05-29T13:51:01+0000",
        "updated_time" : "2012-05-29T13:51:01+0000",
        "comments" : {
            "count" : 0
        }
    },

Above has type status and a message. Below has type status and a story.

{
        "id" : "<<Some ID>>",
        "from" : {
            "name" : "<<A Friend>>",
            "id" : "<<Some ID>>"
        },
        "story" : "<<A Friend>> likes a photo.",
        "story_tags" : {
            "0" : [{
                    "id" : <<Some ID>>,
                    "name" : "<<A Friend>>",
                    "offset" : 0,
                    "length" : 14,
                    "type" : "user"
                }
            ]
        },
        "type" : "status",
        "created_time" : "2012-05-29T13:40:42+0000",
        "updated_time" : "2012-05-29T13:40:42+0000",
        "comments" : {
            "count" : 0
        }
    },

Thanks for the replies, and sorry if I'm being captain obvious!

like image 507
Sjaak van der Heide Avatar asked May 29 '12 14:05

Sjaak van der Heide


2 Answers

The difference is pretty basic:

  • Status is something that the user has composed and posted themselves
  • Story is something that has been posted on the user's behalf because of an action they have taken.

Of course, some apps may confuse the issue by posting status updates that are merely the same thing as stories, this is just because a Status update can consist of practically anything bit of free text at all.

like image 105
Matthew Johnston Avatar answered Dec 29 '22 00:12

Matthew Johnston


in case anyone is wondering how to deal with this, in my app i basically did the following:

var newPost = ...data.message || ...data.story

in my app I was doing something similar; showing social media feeds on my site but some of them came back as undefined due to them being story instead of message. this way if message is undefined it will fall back to story.

replace the ... with however your response comes back to you ;D

like image 38
Qamar Stationwala Avatar answered Dec 28 '22 22:12

Qamar Stationwala