FoxBoom!

I am the fox, goo-goo-ga-choob

del.icio.us JSON

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>

Leave a comment: