Skip to content

Instantly share code, notes, and snippets.

View zoka123's full-sized avatar

Zoran Antolović zoka123

View GitHub Profile
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="canonical" href="" />
<meta name="content-language" content="en" />
<meta http-equiv="Content-Language" content="en" />

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
@zoka123
zoka123 / Quick uninstall JetBrains settings
Created February 12, 2015 16:05 — forked from denji/README.md
Quick uninstall JetBrains settings
Quick uninstall JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s