开发者

Custom social buttons with counters?

How would one go about creating custom social buttons (specifically Post to Twitter, Facebook, Stumblepon, Reddit) - with count开发者_开发知识库ers. 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.


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.com/countserv/count/share?url=http://news.ycombinator.com
  • Facebook - http://graph.facebook.com/http://news.ycombinator.com

Twitter has removed their undocumented API endpoint.

  • Twitter - http://urls.api.twitter.com/1/urls/count.json?url=http://news.ycombinator.com


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.com/pages/tweet_button

Alternatively you could use Javascript to grab the button node and attach the count details to your own buttons.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜