davidfq / social-links-counters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Social share links counters

Another take on jquery plugins like sharrre.com or social-likes, using a progressive enhancement approach. Just plain simple HTML links for social sharing, instead of empty elements.

Update 23/2015

Twitter has deprecated its "undocumented count API", so only Facebook is supported by now. - Hard decisions for a sustainable platform

Usage

If you have a link like this in your page:

<a class="social-share" href="https://www.twitter.com/intent/tweet?url=[url]">share on twitter</a>

Initialize the plugin:

$('.social-share').socialShareCounters({
  innerSpan: true,
  spanClass: 'social-share__counter'
});

And the original link becomes in:

<a class="social-share" data-counter="[count]" href="https://www.twitter.com/intent/tweet?url=[url]">share on twitter <span class="social-share__counter">[count]<span></a>

## TODO

  • Add "popup" option.
  • Add more social networks (currently 0.3.0, only Facebook is supported).
  • Trigger custom events when counters are ready.
  • Add Google Analytics support.

Resources

About

License:MIT License


Languages

Language:JavaScript 75.8%Language:HTML 24.2%