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 badges
Add a ment  | 

2 Answers 2

Reset to default 11

A 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