使用圖形API
回答
我不認爲這是有可能得到像從圖形API的數量,你應該使用FQL link_stat table。 FQL不被棄用。
向下投票,因爲這是不正確的,根據@chandrajeet回答 – Luke 2014-03-18 08:57:10
更新 - 四月'15:
如果你想獲得那就是在Like按鈕可用計數,你應該使用engagement
字段中og_object
對象,像這樣:
https://graph.facebook.com/v2.2/?id=http://www.MY-LINK.com&fields=og_object{engagement}&access_token=<access_token>
結果:
{
"og_object": {
"engagement": {
"count": 93,
"social_sentence": "93 people like this."
},
"id": "801998203216179"
},
"id": "http://techcrunch.com/2015/04/06/they-should-have-announced-at-420/"
}
這是可能的圖形API,只需使用:
http://graph.facebook.com/?id=YOUR_URL
類似:
http://graph.facebook.com/?id=http://www.google.com
將返回:
{
"id": "http://www.google.com",
"shares": 1163912
}
UPDATE:而上面會回答如何獲得分享伯爵。這個數字是不等於你在Like Button看到一個,因爲這個數字的總和:
- 這個URL
- ,此網址的股份數量的喜歡的(這包括數將鏈接複製/粘貼回Facebook)
- Facebook上關於此URL的點贊和評論數
- 包含此URL作爲附件的收件箱郵件的數量。
因此獲得Like按鈕數量是可能通過fql
終點的圖形API(在link_stat
表):
https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count,commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url='http://www.google.com'
total_count
是顯示了Like按鈕的數量。
你不應該使用圖形api。如果您透過電話:
或
都將返回:
{
"id": "http://www.apple.com",
"shares": 1146997
}
但顯示的數字是的總和:
- 數目這個URL
- 數的這個URL的股的喜歡的(這包括複製/粘貼鏈接回到Facebook)的
- 數Facebook上有關此URL的故事的評論和評論
- 包含此URL作爲附件的收件箱郵件的數量。
所以你必須使用FQL。
看看這個答案:How to fetch facebook likes, share, comments count from an article
你是絕對正確的,通過total_shares是的評論+喜歡+股 但我請求的頁面總和,顯示shares_i_have = total_shares +喜歡 – Aziz 2012-02-22 05:58:29
當我用FQL我發現這個問題(但它仍然是問題) 的文件說,顯示的數字是的總和:
- 數量的這種喜歡的URL
- 號,此網址的股份(此 包括複製/粘貼鏈接回到Facebook的)這個網址在Facebook上
- 號喜歡和 意見對故事
- 收件箱號碼 包含此URL作爲附件的郵件。
,但在我的網站所示數量爲這4個計數總和+股數(再次)
像按鈕Facebook的做了兩兩件事,該API不會做。當你比較兩者時,這可能會造成混亂。
如果你在像按鈕使用URL有重定向的按鈕將實際顯示重定向URL與您所使用的URL的數量的計數。
如果頁面有一個og:url屬性,like按鈕將顯示喜歡的URL,而不是瀏覽器中的URL。
希望這可以幫助別人
這裏的API鏈接的列表,讓您的數據:
Facebook的: https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
reddit的:http://buttons.reddit.com/button_info.json?url=%%URL%%
LinkedIn:http://www.linkedin.com/countserv/count/share?url=%%URL%%&format=json
Digg: 種http://widgets.digg.com/buttons/count?url=%%URL%%
美味:
的StumbleUpon: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=%%URL%%
Pinterest的: http://widgets.pinterest.com/v1/urls/count.json?source=6&url=%%URL%%
編輯: 刪除Twitter的終點,因爲這一個已被棄用。
編輯: Facebook的REST API已被棄用
使用FQL,你可以這樣做:
http://graph.facebook.com/fql?q=SELECT url, total_count FROM link_stat WHERE url='PASTE_YOUR_URL_HERE'
有它紅寶石寶石 - SocialShares
目前,它支持以下社交網絡:
- 嘰嘰喳喳
- 谷歌加
- 書籤交易
- Pinterest的
- 的StumbleUpon
- VKontakte等
- mail.ru
- odnoklassniki
ù鼠尾草:
:000 > url = 'http://www.apple.com/'
=> "http://www.apple.com/"
:000 > SocialShares.facebook url
=> 394927
:000 > SocialShares.google url
=> 28289
:000 > SocialShares.twitter url
=> 1164675
:000 > SocialShares.all url
=> {:vkontakte=>44, :facebook=>399027, :google=>28346, :twitter=>1836, :mail_ru=>37, :odnoklassniki=>1, :reddit=>2361, :linkedin=>nil, :pinterest=>21011, :stumbleupon=>43035}
:000 > SocialShares.selected url, %w(facebook google linkedin)
=> {:facebook=>394927, :google=>28289, :linkedin=>nil}
:000 > SocialShares.total url, %w(facebook google)
=> 423216
:000 > SocialShares.has_any? url, %w(twitter linkedin)
=> true
結帳this gist。它有如何獲得以下服務共享計數片段:
- Facebook的
- Twitter的
- 谷歌,加上
- Pinterest的
- StumbledUpon
這是幾年的歷史。每個服務更新其API的頻率,我懷疑它是非常準確的。 – subvertallchris 2015-04-14 18:36:03
什麼我發現有用的,我發現上面的一個鏈接是這個FQL查詢,你問對於喜歡,總,共享和點擊一個鏈接數通過查看link_stat表
https://graph.facebook.com/fql?q=SELECT%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20FROM%20link_stat%20WHERE%20url%20=%20%22http://google.com%22
這將輸出這樣的事情:
{
data: [
{
like_count: 3440162,
total_count: 13226503,
share_count: 7732740,
click_count: 265614,
comment_count: 2053601
}
]
}
截至2016年8月8日,FQL將不再可用且無法查詢。要遷移您的應用,請使用API升級工具查看您可以改爲創建的圖表API調用。 – 2016-08-04 12:52:47
8月7日以後年,2016年仍然可以使您的通話像這樣:
http://graph.facebook.com/?id=https://www.apple.com/
但響應格式將是不同的:它不會是
{
"id": "http://www.apple.com",
"shares": 1146997
}
,而是它會
{
"og_object": {
"id": "388265801869",
"description": "Get a first look at iPhone 7, Apple Watch Series 2, and the new AirPods \u2014 the future of wireless headphones. Visit the site to learn more.",
"title": "Apple",
"type": "website",
"updated_time": "2016-09-20T08:21:03+0000"
},
"share": {
"comment_count": 1,
"share_count": 1094227
},
"id": "https://www.apple.com"
}
所以,你將不得不處理這樣的迴應:
reponse_variable.share.share_count
但SHARE_COUNT值是一種誤導,因爲它是指喜歡+股 – 2017-03-05 10:21:29
我想你是對的總和,我的回答只是如何調用API的更新。我認爲@freedev關於股票數量的評論可能仍然是正確的。 – 2017-03-08 09:14:40
太棒了!多數民衆贊成唯一一個真正有效的,你不需要一個應用程序ID! – neoswf 2018-02-21 11:30:27
只需輸入https://graph.facebook.com/?fields=share&id=https://www.example.com
,並與您的網址或網頁您正在尋找替代例如。谷歌的
例子: https://graph.facebook.com/?fields=share&id=https://www.google.com
- 1. 使用圖形API
- 2. 使用圖形API
- 3. 使用圖形API
- 4. 如何使用圖形API
- 5. 喜歡使用圖形API
- 6. 如何使用圖形API
- 7. 如何使用圖形API
- 8. 如何使用圖形API
- 9. 使用圖形API 2.7
- 10. 使用Facebook的圖形API
- 11. 籤使用圖形API
- 12. 評論使用Facebook圖形API api
- 13. 使用圖形API發佈圖像
- 14. 使用java圖形API繪製圖層
- 15. 使用圖形api構建圖片
- 16. Facebook圖形API,沒有使用圖片
- 17. 使用圖形API更新用戶「relationship_status」
- 18. Google圖形API /某種圖形API
- 19. 使用圖形API獲取圖像的縮略圖Api
- 20. 如何通過形式上傳圖片使用圖形API
- 21. 使用java圖形API(2D/3D/OpenGL /等)的交互式圖形?
- 22. 如何使用Microsoft圖形API
- 23. 檢索使用FB圖形API
- 24. 使用Google Chart API註釋條形圖
- 25. 號線使用Java圖形API
- 26. 使用圖形API獲取Facebook反應
- 27. 接受或使用FB圖形API
- 28. 「喜歡」使用Facebook的圖形API
- 29. 如何使用圖形API在Facebook的
- 30. 使用Facebook的圖形API和HybridAuth
獲取您的解決方案在這裏http://stackoverflow.com/questions/6137414/how-to-fetch-facebook-likes-share-comments-count-from-一篇文章 – 2013-06-14 14:28:10
請檢查答案在這裏:http://stackoverflow.com/questions/9728279/getting-the-facebook-like-share-count-for-a-given-url/35062056#35062056 – 2016-01-28 12:54:07
Post 8月8日, 2016(非棄用)回答:http://stackoverflow.com/a/39379251/4607317 – 2016-10-17 19:45:06