del.icio.us JSON
Published on Saturday, August 11th 2007 at 11:09 am by FoxBoom!
Since I’m not getting my new TV today, I decided to have the next-best amount of fun. Javascript!
I just discovered that del.icio.us provides JSON feeds, so I modified their “latest posts” example and stuck it in the sidebar.
<div id="recent-delicious-bookmarks" />
<script type="text/javascript" src="http://del.icio.us/feeds/json/foxboom?count=10"></script>
<script type="text/javascript">
var ul = document.createElement('ul');
for (var i=0, post; post = Delicious.posts[i]; i++)
{
var li = document.createElement(’li’);
var a = document.createElement(’a');
a.setAttribute(’href’, post.u);
a.appendChild(document.createTextNode(post.d));
li.appendChild(a);
ul.appendChild(li);
}
document.getElementById(’recent-delicious-bookmarks’).appendChild(ul);
</script>
Categories: Software Development | Tags: del.icio.us, javascript, json |
Leave a comment below, or trackback from your own blog.