// JavaScript Document
$(document).ready(function(){
 var tweeturl = "http://api.twitter.com/1/statuses/user_timeline/deferrers.json?count=5&callback=?";
  $.getJSON(tweeturl, function(data){
    $.each(data, function(i, item) {
      var txt = item.text
	      .replace(/(https?:\/\/[-a-z0-9._~:\/?#@!$&\'()*+,;=%]+)/ig,'<a href="$1">$1</a>')
	      .replace(/@+([_A-Za-z0-9-]+)/ig, '<a href="http://twitter.com/$1">@$1</a>')
	      .replace(/#+([_A-Za-z0-9-]+)/ig, '<a href="http://search.twitter.com/search?q=$1">#$1</a>');
	    $("<p></p>").addClass(i%2 ? 'even' : 'odd').html(txt).appendTo('#tweet');
	  });
  });
  
});
