Now when we have learned how to customize your count for RSS and Digg it's time to learn how to do it for del.icio.us like I'm using on my themes page for example. As del.icio.us is in top 3 you just have to have it for bookmarking services because it usually gives most of the traffic right after StumbleUpon.

To make your count into plain text (for now and then you can do with it what ever you want) we'll use small JavaScript and del.icio.us JSON feeds (read more about it here). You can see all kind of other services in your del.icio.us. setting account (for example network badges etc). So, let's start with the code.
Since you are probably going to use this with WordPress i'll be using it for example too. So to bookmark something to del.icio.us you are using code similar to this:
<a href="http://del.icio.us/post?url=<?php echo get_permalink() ?>&title=<?php the_title(); ?> "> save to del.icio.us </a>
Now where you want to have the count add this line (i have added it in span next to link) and just past this JavaScript under it and you're done
<span id='<?php echo md5("http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);?> '>0</span>
<script type='text/javascript'>
function displayURL(data) {
var urlinfo = data[0];
if (!urlinfo.total_posts) return;
document.getElementById("<?php echo md5("http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);?>").innerHTML = urlinfo.total_posts;
}
</script>
<script src='http://badges.del.icio.us/feeds/json/url/data?url=<?php the_permalink() ?>&callback=displayURL'></script>
Questions, problems? Post them here in comments
on July 27, 2008
Wallace
I use it on top of my page…