Tilt-logo

Things I Learned Today - our daily eureka-moments

Carr
proppi
Edland
feenyx
Programming .NET VS2010 Web Windows VS2012 S3 Search SQL SqlMetal Accessibility Amazon Android App BBQ EBS EC2 Exchange Food Garmin Geocaching GPS Grill Java Linq Lucene MVC PowerShell

Social buttons on websites - Carr, 18.08.2011

While trying to place some social buttons on this blog, I started by digging into the documentation for each major site:

Facebook's Like-button
Google's +1-button
Twitter's tweet-button
.. etc.

Pretty simple stuff, but unless you're afraid of depending on another third party, it's even simpler:
AddThis.com

One tiny block of very readable, very configurable tags, and they'll handle it all for you and keep your code updated. One neat feature is to let them decide which buttons to display, based on which services the user prefers. Tumblr users will see a tumblr button, g+ users will see another.

Oh, and they support over 300(!) services. Neat!


Here's the code currently being used for the buttons above this post:


<div class="addthis_toolbox addthis_default_style">
    <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
    <a class="addthis_button_tweet"></a>
    <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e4a89506768955b"></script>

Tags: Programming Web
Comments:
Nobody has commented on this post yet. Feel free to be the first!