Skip to content

Instantly share code, notes, and snippets.

View amitsquare's full-sized avatar

Amit Sharma amitsquare

  • DGM-india
  • D-60/kalkaji,new-delhi,india-110019
View GitHub Profile
@amitsquare
amitsquare / index.html
Created January 30, 2019 17:31 — forked from mcxiaoke/index.html
detect app installed in browser
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
@amitsquare
amitsquare / authplugin.toml
Created March 16, 2018 07:41 — forked from andris9/authplugin.toml
zonemta authentication
# store to config/plugins/authplugin.toml
[authplugin]
enabled="receiver"
@amitsquare
amitsquare / gist:67ad89e1c1e22229aac5cf5ca0e3653e
Created April 5, 2017 18:25 — 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