What is the difference between a "story" and a "message" in a response to me / home JSON

I am creating an application that receives status updates from several social networks. I already have Twitter working like a charm. But now that I have to work with the Facebook Graph API, mysterious things appear. Similar to the fact that the message contains a message or history (not both, as far as I know). I could not find the difference between the two.

I thought this was probably due to the type of message, but I did not find out that type links, status, photos and videos can contain either a message or a story. Then there is a swf that I saw only with the message.

Can someone tell me the deal is here? Is the real difference only in that one is a real status update and the other is just β€œsimilar” or something like that?

JSON example:

{ "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 type status and message. Below is the status and history.

 { "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 answers, and sorry if I will be the captain obvious!

+4
source share
2 answers

The difference is pretty simple:

  • State is what the user wrote and posted
  • A story is what was published on behalf of the user due to the action they took.

Of course, some applications can confuse this problem by publishing status updates that are just the same as the stories, this is only due to the fact that the status update can consist of almost any piece of free text in general.

+6
source

if someone wonders how to deal with this, in my application I basically did the following:

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

I did something similar in my application; showing social media channels on my site, but some of them returned as undefined due to the fact that they were a story, not a message. thus, if the message is undefined, it will return to history.

replace ... nonetheless your answer will come back to you, D

0
source

Source: https://habr.com/ru/post/1414912/


All Articles