var stream = [{"id":"qbcc3","type":"jpg","message":"I loved seeing the ESB in blue tonight! (for Madison Square Park Boys & Girls Club 125th anniversary, via @esbColors).","timestamp":"1258774396"},{"id":"q6llf","type":"jpg","message":"The chocolate bar at Max Brenner's Chocolate by the Bald Man in @BryantParkNYC's @BPHolidayshops","timestamp":"1258686766"},{"id":"q5wxg","type":"jpg","message":"The @ESB_Lights tonight amid the mist! or Fog?","timestamp":"1258676495"},{"id":"q42fa","type":"jpg","message":"Such a cool concert hall! (Alice Tully, Lincoln Center again)","timestamp":"1258648090"},{"id":"q424v","type":"jpg","message":"Such an awesome building - Alice Tully Hall, Lincoln Center, 65th & Broadway.","timestamp":"1258647941"}]; function twitpicBuildBadge() { document.write("
"); var statusHTML = ""; for (var i=0; i'+stream[i].message+' '+relative_time(stream[i].timestamp)+'
') } document.getElementById('twitpic_badge_container_v1').innerHTML = '
Twitpic Updates
' + statusHTML + '
View my photos'; } function relative_time(time_value) { var parsed_date = time_value; //var relative_to = new Date(); //var delta = parseInt((relative_to.getTime() / 1000) - parsed_date); var delta = parseInt((1258778645) - parsed_date); //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'; } } twitpicBuildBadge();