mardi 21 avril 2015

Facebook GraphAPI and FQL API return different value for same URL

I trying to migrate my facebook app from FQL API (1.0) to GraphAPI (2.3) and i encounter some problems.

Main goal of my facebook application is fetching current count of likes, shares and comments for specified links (article url). (I think, something similar to How to get facebook share, like, comment count for a url with graph api only (in a non-deprecated way))

In (old) FQL API i could get this information by executing SELECT ... FROM link_stat table. ex.:

http://ift.tt/1yuEsAd"http%3A//http://ift.tt/1zgkOCG"%29

which return information in JSON, ex.:

{
 "data": [
  {
   "like_count": 21, 
   "comment_count": 0, 
   "click_count": 0, 
   "commentsbox_count": 0, 
   "total_count": 29, 
   "share_count": 8, 
   "normalized_url": "http://ift.tt/1zgkOCG"
  }
 ]
}

In new GraphAPI (2.3) theoretically this information is available via:

URL and /{object-id}/likes edges:

http://ift.tt/1zgkOCM http://ift.tt/1yuEsAf

Which return value. ex.:

{
 "share": {
  "comment_count": 0, 
  "share_count": 42
 }, 
 "og_object": {
  "url": "http://ift.tt/1zgkOCG", 
  "description": "Kibice wstrzymali oddech, dos\u0142ownie. W sali s\u0142ycha\u0107 by\u0142o tykaj\u0105c\u0105 wskaz\u00f3wk\u0119 zegara zawieszonego na \u015bcianie. Przy stole sta\u0142 Bogdan Wo\u0142kowski, nieruchomo patrzy\u0142 na \u015brodek, gdzie znajdowa\u0142a si\u0119 wysoka piramida z\u0142o\u017cona z kilku poziom\u00f3w bil i tr\u00f3jk\u0105t\u00f3w. Na jej szczycie sta\u0142 cz\u0142owiek. Mija\u0142y kolejne sekundy, napi\u0119cie ros\u0142o. Nagle \"Wizard\" wzi\u0105\u0142 kij do r\u0119ki, przymierzy\u0142, hukn\u0105\u0142 w bil\u0119, ta uderzy\u0142a w piramid\u0119 i...", 
  "type": "article", 
  "title": "\u015awiat pokocha\u0142 polskiego sportowca. Mimo \u017ce ledwo duka\u0142 po angielsku", 
  "updated_time": "2015-04-14T19:46:03+0000", 
  "id": "1055320127830544"
 }, 
 "id": "http://ift.tt/1zgkOCG"
}

and

{
 "1055320127830544": {
  "data": [], 
  "summary": {
   "total_count": 0
  }
 }
}

Unfortunately this values isn't consistent with results from FQL API .

So, my question is: What mean each value in response, and why it is not consistent with FQL?

Aucun commentaire:

Enregistrer un commentaire