Skip to content

Instantly share code, notes, and snippets.

View MHerbst's full-sized avatar
💭
I may be slow to respond.

Martin Herbst MHerbst

💭
I may be slow to respond.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MHerbst on github.
  • I am martinherbst (https://keybase.io/martinherbst) on keybase.
  • I have a public key whose fingerprint is E212 14B3 8E8B EE10 C759 E221 C95F E567 723F D5B9

To claim this, I am signing this object:

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

@MHerbst
MHerbst / sitemap.lens
Last active December 17, 2015 23:39
Lens template to create a sitemap
<koken:variable name="m1" value="<" />
<koken:variable name="m2" value="?" />
{{ m1 }}{{ m2 }}xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<koken:load source="essays">
<koken:loop>
<url>
<loc>{{ essay.url }}</loc>
<lastmod>{{ essay.modified_on.timestamp date_format="Y-m-d"}}</lastmod>
<changefreq>weekly</changefreq>