簡體   English   中英

在網站上獲取社交媒體共享/喜歡計數

[英]Get Social Media Share/Like Count on the Site

有什么方法可以在網頁上獲得喜歡和分享的社交媒體?

我正在嘗試針對Facebook,Twitter,Google +。 對於facebook,它正在工作,但是對於twitter和google +,我找不到任何。

我嘗試下面的方式。

 .fa { padding: 20px; font-size: 30px; width: 50px; text-align: center; text-decoration: none; margin: 5px 2px; } .fa:hover { opacity: 0.7; } .fa-facebook { background: #3B5998; color: white; } .fa-twitter { background: #55ACEE; color: white; } .fa-google { background: #dd4b39; color: white; } .fa-linkedin { background: #007bb5; color: white; } .fa-pinterest { background: #cb2027; color: white; } .fa-yahoo { background: #430297; color: white; } p{ font-size:14px; } 
 <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://webcyou.github.io/social-share-count-js/js/social-share-count.js"></script> <title>Share Count</title> </head> <body> <a href="#" class="fa fa-facebook"> <p data-sc-fb="http://www.eventbee.com"></p> </a> <a href="#" class="fa fa-twitter"> <p data-sc-tw="https://stackoverflow.com"></p> </a> <a href="#" class="fa fa-twitter"> <p data-sc-tw="https://draxe.com/emotions-lower-inflammation.com"></p> </a> <a href="#" class="fa fa-google"> <p data-sc-gp="http://www.webcyou.com"></p> </a> <a href="#" class="fa fa-pinterest"> <p data-sc-pr="https://www.google.com/"></p> </a> <a href="#" class="fa fa-linkedin"> <p data-sc-ln="https://www.yahoo.com/"></p> </a> </body> </html> 

這里的推文計數來自stackoverflow.com,而不是https://draxe.com/emotions-lower-inflammation/

PS-我發現twitter和google +已經停止了該api,但是應該有一些第三方api嗎?

您可以嘗試使用https://www.sharedcount.com

他們提供API來跟蹤不同社交媒體網站中的喜歡和分享。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM