Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Forked from danott/sharing.md
Created December 4, 2012 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeholder/4201610 to your computer and use it in GitHub Desktop.
Save lukeholder/4201610 to your computer and use it in GitHub Desktop.
Sharing Buttons Reference

Pinterest

Documentation

<!-- An individual link -->
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Funitedway.com&media=http%3A%2F%2Fplacehold.it%2F200x200&description=A%20description." class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>

<!-- before </body> -->
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>

Facebook

Documentation

Open Graph properties required on a per/page basis for Facebook sharing to behave as expected. Note: You'll have to setup an application on Facebook. You'll need to replace YOUR_FACEBOOK_APP_ID_GOES_HERE with the numerical application id.

<!-- In the document head -->
<meta property="og:title" content="Title" />
<meta property="og:type" content="product" />
<meta property="og:url" content="http://uri.to/share" />
<meta property="og:image" content="http://placehold.it/200x100" />
<meta property="og:site_name" content="United Way" />

<!-- An individual like button -->
<div class="fb-like" data-href="http://uri.to/share" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="arial"></div>

<!-- Anywhere on the page -->  
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR_FACEBOOK_APP_ID_GOES_HERE";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Twitter

Documentation

<a href="http://uri.to/share" class="twitter-share-button" data-lang="en">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Google+

Documentation

<!-- Place this tag in your head or just before your close body tag. -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
  
<!-- Place this tag where you want the share button to render. -->
<div class="g-plus" data-action="share" data-annotation="bubble" data-href="http://uri.to/share"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment