0

我对 Twitter 和 Google Plus 的 API 不太熟悉。有人可以解决我的问题吗?我想在我的 Twitter、Google Plus 和 Stumble Upon 按钮上添加一个计数器。这将集成到我的 wordpress 帖子和页面中。我认为已经实现了 facebook 按钮。我剩下的唯一问题是 Twitter、Google Plus 和 Stumble Upon(可选)。

谢谢你!

<!-- 
Facebook
/////////////////
--> 
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

    <a href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(get_permalink()); ?>&t=<?php echo urlencode(get_the_title()); ?>"  name="fb_share" type="box_count" target="_blank" id="facebook">
    Share
</a>


<!-- 
Twitter
/////////////////
--> 

<a href="http://twitter.com/share?url=<?php echo urlencode(get_permalink()); ?>&text=<?php echo urlencode(get_the_title()); ?>" class="twitter-share-button" id='twitter' target="_blank">
    Tweet
</a>


<!-- 
Google Plus
/////////////////
--> 

<a href="https://m.google.com/app/plus/x/?v=compose&content=<?php echo urlencode(get_permalink()) . " " . urlencode(get_the_title()); ?>" id='gplus' target="_blank">
    Google Plus
</a>


<!-- 
Stumble Upon
/////////////////
--> 

<a href="http://www.stumbleupon.com/submit?url=<?php echo urlencode(get_permalink()); ?>" target="_blank" id='stumble'>
    Stumble
</a>
4

3 回答 3

1

Twitter 分享数:https ://twitter.com/about/resources/buttons

Google+ +1 计数:http ://www.google.com/webmasters/+1/button/

于 2012-04-14T23:44:29.780 回答
0
 <div class="addthis_toolbox addthis_floating_style addthis_counter_style"    style="left:50px;top:160px;">
 <a class="addthis_button_facebook_like" fb:like:layout="box_count"></a>
 <a class="addthis_button_tweet" tw:count="vertical"></a>
 <a class="addthis_button_google_plusone" g:plusone:size="tall"></a>
 <a class="addthis_counter"></a>
 </div>
 <script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; </script>
 <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5178354276acf324"></script>
于 2013-04-25T19:56:22.137 回答
0

您可以使用 jQuery 来获取计数器...

我有一个针对 Facebook Pinterest 和 Twitter https://gist.github.com/andrefrd/9520512的要点

于 2014-03-13T01:51:46.427 回答