To get your Delicious save count in plain text, simply open the single.php file from your theme and paste the following code where you'd like the count to be displayed.
Delicous.com saves: <span id='del'>0</span>
<script type='text/javascript'>
function displayURL(data) {
var urlinfo = data[0];
if (!urlinfo.total_posts) return;
document.getElementById("del").innerHTML = urlinfo.total_posts;
}
</script>
<script src='http://badges.del.icio.us/feeds/json/url/data?url=<?php the_permalink() ?>&callback=displayURL'></script>
Getting our Delicious save count isn't hard at all. On this exemple, I have created a html element with a specific id and then imported a script from delicious. Once the script is loaded, I executed a function to replace the initial zero with the current number of saves for the specific item.
If you'd like to allow your users to directly save your posts to their delicious account without leaving your blog, you should read this recipe.
2 Responses
STUMBLED!
This is exactly what I need, thanks for posting.
Trackbacks: