简体   繁体   中英

Custom social buttons with counters?

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.

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.

Twitter has removed their undocumented API endpoint.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM