admin管理员组文章数量:1342529
How would one go about creating custom social buttons (specifically Post to Twitter, Facebook, Stumblepon, Reddit) - with counters. The buttons need the same consistent styling as part of a design and we ideally don't want to use the out-of-the-box ones as such.
Creating custom buttons is easy - but custom counters I'm not sure about. How could this be achieved?
Thanks in advance for any suggestions.
How would one go about creating custom social buttons (specifically Post to Twitter, Facebook, Stumblepon, Reddit) - with counters. The buttons need the same consistent styling as part of a design and we ideally don't want to use the out-of-the-box ones as such.
Creating custom buttons is easy - but custom counters I'm not sure about. How could this be achieved?
Thanks in advance for any suggestions.
Share Improve this question asked Apr 26, 2011 at 23:57 samenglandsamengland 1112 silver badges5 bronze badges2 Answers
Reset to default 11A number of social sites provide APIs methods for getting the share count for a specific URL. Some of the API methods are internal and not publicly supported.
- LinkedIn - http://www.linkedin./countserv/count/share?url=http://news.ybinator.
- Facebook - http://graph.facebook./http://news.ybinator.
Twitter has removed their undocumented API endpoint.
Twitter - http://urls.api.twitter./1/urls/count.json?url=http://news.ybinator.
I'm not 100% sure about the Facebook API, but the Twitter API allows you to custom style the buttons. You can find it under the heading "Build Your Own Tweet Button" which is at the bottom of the following page:
https://dev.twitter./pages/tweet_button
Alternatively you could use Javascript to grab the button node and attach the count details to your own buttons.
本文标签: javascriptCustom social buttons with countersStack Overflow
版权声明:本文标题:javascript - Custom social buttons with counters? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743702443a2524551.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论