【问题标题】:Get Social Media Share/Like Count on the Site在网站上获得社交媒体分享/点赞数
【发布时间】:2018-02-26 18:43:40
【问题描述】:

有什么方法可以让社交媒体在网页上获得点赞和分享次数?

我正在为 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 吗?

【问题讨论】:

    标签: javascript php jquery asp.net asp.net-mvc


    【解决方案1】:

    您可以尝试使用 https://www.sharedcount.com

    它们提供 API 用于跟踪不同社交媒体网站中的点赞和分享。

    【讨论】:

    • 我认为是付费的。有没有免费的替代品?
    • github.com/heiseonline/shariff 也许这是一个选项?据我所知,这显示了一个带有计数器的共享按钮。
    • 我认为他们每天提供大约 10K 次免费 API 调用
    • {"StumbleUpon":1,"Pinterest":9,"LinkedIn":3744,"Facebook":{"total_count":168,"comment_count":53,"reaction_count":14, "share_count":101,"comment_plugin_count":0}} 我试过了,但没有 Google+ 和 twitter。
    猜你喜欢
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 2013-11-27
    • 1970-01-01
    • 2020-03-02
    • 2017-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多