Skip to content

Instantly share code, notes, and snippets.

View cynthiaho711's full-sized avatar

Cynthia Ho Sin Tian cynthiaho711

View GitHub Profile
@cynthiaho711
cynthiaho711 / guardian_gaza.ipynb
Created February 10, 2017 08:19 — forked from darribas/guardian_gaza.ipynb
A IPython Notebook to analyze the Gaza-Israel 2012 crisis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cynthiaho711
cynthiaho711 / gist:c75e51d71c79ace0eddd1c3639729bd2
Created November 16, 2016 15:07 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

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