Skip to content

Instantly share code, notes, and snippets.

Avatar

Axel Roche aquelito

View GitHub Profile
View gist:8063540

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

View Preferences.sublime-settings.json
// Place your settings in the file "User/Preferences.sublime-settings", which
// overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overridden in the platform
@aquelito
aquelito / article-BlogPosting.html
Created Nov 6, 2012
Page Article Schema - BlogPosting
View article-BlogPosting.html
<!DOCTYPE html>
<html lang="fr" itemscope itemtype="http://schema.org/WebPage">
<head>
<meta charset="UTF-8" />
<title>Titre de l'article</title>
<meta itemprop="name" content="Titre de l'article" />
<meta itemprop="description" content="Coutre description de l'article" />
</head>
<body>
<div id="wrapper">
@aquelito
aquelito / editor_plugin.js
Created Oct 18, 2012
WordPress Tiny MCE - Change Language Attributes
View editor_plugin.js
/*
* plugin/tinymce/editor_plugin.js
*/
(function(){
tinymce.PluginManager.requireLangPack('languages');
tinymce.create('tinymce.plugins.languages', {
createControl: function(n, cm){
/*var list, listlang = {
'en': 'English',
@aquelito
aquelito / output.css
Created Apr 16, 2012
SCSS Compass Font Size - Vertical Rhythm
View output.css
html {
font: 100%/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif; }
body {
background-image: -webkit-gradient(linear, 50% 100%, 50% 0%, color-stop(5%, #e1e1e1), color-stop(5%, rgba(225, 225, 225, 0)));
background-image: -webkit-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: -moz-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: -o-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);