function twitterCallback2(twitters) {
  var statusHTML = [];
  for (var i=0; i<twitters.length; i++){
    var username = twitters[i].user.screen_name;
    var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
      return '<a href="'+url+'">'+url+'</a>';
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
    });
    statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id+'">'+relative_time(twitters[i].created_at)+'</a></li>');
  }
  document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');
}

function relative_time(time_value) {
  var values = time_value.split(" ");
  time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
  var parsed_date = Date.parse(time_value);
  var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
  var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
  delta = delta + (relative_to.getTimezoneOffset() * 60);

  if (delta < 60) {
    return 'less than a minute ago';
  } else if(delta < 120) {
    return 'about a minute ago';
  } else if(delta < (60*60)) {
    return (parseInt(delta / 60)).toString() + ' minutes ago';
  } else if(delta < (120*60)) {
    return 'about an hour ago';
  } else if(delta < (24*60*60)) {
    return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
  } else if(delta < (48*60*60)) {
    return '1 day ago';
  } else {
    return (parseInt(delta / 86400)).toString() + ' days ago';
  }
}
twitterCallback2([{"created_at":"Mon Feb 13 02:15:44 +0000 2012","in_reply_to_status_id_str":null,"place":null,"in_reply_to_user_id_str":"15467920","in_reply_to_user_id":15467920,"in_reply_to_status_id":null,"user":{"listed_count":286,"profile_background_image_url":"http:\/\/a1.twimg.com\/profile_background_images\/109817512\/x2ee90cbb15315fe04cea30d12adcf03.png","created_at":"Mon Apr 26 20:45:08 +0000 2010","followers_count":3015,"protected":false,"profile_image_url":"http:\/\/a2.twimg.com\/profile_images\/1149281586\/Alexandra_Fun___Fit_head_shot_normal.jpeg","lang":"en","profile_link_color":"131314","name":"Alexandra Williams","default_profile":false,"show_all_inline_media":false,"notifications":null,"utc_offset":-28800,"profile_background_color":"993b09","description":"Twin & I R fitness experts.Writer\/Editor\/Speaker\/Emcee. ACE Cert 20+ yrs.Editor @ IDEA Fitness Jrnal.FitFluential Ambassador http:\/\/xeeme.com\/AlexandraFunFit\/","screen_name":"Alexandrafunfit","profile_background_tile":true,"time_zone":"Pacific Time (US & Canada)","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1149281586\/Alexandra_Fun___Fit_head_shot_normal.jpeg","statuses_count":30660,"geo_enabled":false,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/109817512\/x2ee90cbb15315fe04cea30d12adcf03.png","profile_sidebar_fill_color":"ff5b0f","location":"Santa Barbara","id_str":"137462549","default_profile_image":false,"following":null,"friends_count":2471,"verified":false,"favourites_count":20,"profile_sidebar_border_color":"0f23ff","url":"http:\/\/funandfit.org","is_translator":false,"follow_request_sent":null,"profile_use_background_image":true,"id":137462549,"contributors_enabled":false,"profile_text_color":"191d1f"},"in_reply_to_screen_name":"taraburner","favorited":false,"id_str":"168881008924561408","coordinates":null,"truncated":false,"contributors":null,"retweeted":false,"source":"\u003Ca href=\"http:\/\/twitter.com\/devices\" rel=\"nofollow\"\u003Etxt\u003C\/a\u003E","geo":null,"id":168881008924561408,"retweet_count":0,"text":"@Taraburner Hey Tara, not sure if the shirt came yet, as I won't be back in CA till tomorrow night. Thx 4 checking. hugs"}]);
