Measured Against Reality

Thursday, September 21, 2006

Add Social Bookmarking to Your Blog

I have been searching for a way to add a “Digg This” link to my blogger blog for some time now. I had one that worked for a while, but suddenly stopped a few weeks ago. So I decided to take it into my own hands and cobble something together that just works. It’s not fancy, and it won’t magically fill out all the forms for you, but it does work. I also added most other social bookmarking sites, such as Reddit and Del.icio.us.

Just copy and paste the following into your template, wherever you see fit. I put mine in the post footer (hence the class=”post-footer” in the p tag), but it could go anywhere.

<p class="post-footer">Send this post to:
<a style="float:none;" href="javascript:location.href='http://digg.com/submit?phase=2%26* url='+encodeURIComponent('<$BlogItemPermalinkURL$>')">Digg</a> |
<a style="float:none;" href="http://reddit.com/submit?url=<$BlogItemPermalinkURL$>* &title=<$BlogItemTitle$>">Reddit</a> |
<a style="float:none;" href="http://del.icio.us/post?url=<$BlogItemPermalinkURL$>* &title=<$BlogItemTitle$>">Del.icio.us</a> |
<a style="float:none;" href="http://www.spurl.net/spurl.php?title=<$BlogItemTitle$>* &url=<$BlogItemPermalinkURL$>">Spurl</a> |
<a style="float:none;" href="http://ma.gnolia.com/beta/bookmarklet/add?url=* <$BlogItemPermalinkURL$>">Ma.gnolia</a> |
<a style="float:none;" href="http://www.newsvine.com/_wine/save?u=<$BlogItem* PermalinkURL$>&h=<$BlogItemTitle$>">Newsvine</a></p>



For formatting reasons, I had to put spaces into the code where they wouldn't typically appear in the URLs, marked by a *. You'll have to get rid of those for the code to work.

You can tweak it to fit your tastes, all the different sites work independently (obviously). And if there’s someone out there who could improve this, please do (or anyone who can write a "copy to clipboard" script that works in all browsers). This seems to be something people want, and I can’t find a working version anywhere (except here!).

I hope this gets all your posts a few more hits, and glad I could help.

Labels: , , , , ,

1 Comments:

Post a Comment

<< Home