1

サイト内の各 URL のリアルタイムの Facebook シェアカウントを取得して、表示できるようにしたいと考えています。

私は2つの方法を見つけました:

  1. 次のようにfacebook restserver.phpを使用します。

http://api.facebook.com/restserver.php?method=links.getStats&urls=https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda

そして、これを返します:

<links_getStats_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
<link_stat>
<url>
https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda
</url>
<normalized_url>
https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda
</normalized_url>
<share_count>0</share_count>
<like_count>0</like_count>
<comment_count>0</comment_count>
<total_count>0</total_count>
<click_count>0</click_count>
<comments_fbid>1084234134929324</comments_fbid>
<commentsbox_count>0</commentsbox_count>
</link_stat>
</links_getStats_response>
  1. 次のようにgarph apiを使用します。

https://graph.facebook.com/v2.5/https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda?access_token= ACCESS_TOKEN

そして、次のように返されます。

{
   "og_object": {
      "id": "1084234134929324",
      "description": "Marea Britanie si Irlanda. Marea Britanie spune povestea a trei tari: Anglia, Scotia si Tara Galilor, in care castelele, catedralele pub-uri sunt cu adevarat fermecatoare. In Irlanda va bucurati de peisaje naturale uluitoare, dar si de legende stravechi.",
      "title": "Dal Travel - agentia devoratorilor de turism",
      "type": "website",
      "updated_time": "2016-01-10T12:20:56+0000",
      "url": "https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda"
   },
   "share": {
      "comment_count": 0,
      "share_count": 0
   },
   "id": "https://www.daltravel.ro/circuit/Circuit-Anglia-Scotia-Irlanda"
}

何度か共有しましたが、どちらの方法でも 0 カウントが表示されます。2 番目の方法を使用すると、"updated_time": "2016-01-10T12:20:56+0000" という値も得られます。

最新の情報を入手するにはどうすればよいですか?

ありがとうございました !

4

0 に答える 0