wayne 当前离线
晴天小猪
管理员
<ul id="twitter_list"></ul> <script type="text/javascript"> <!-- //用来处理twitter API 返回的JSON数据 function getTwitter(twitters) { var statusHTML = []; for (var i=0; i<twitters.length; i++){ var username = twitters.user.screen_name; var status = twitters.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 class="tweet">'+status+'<span class="time">'+relative_time(twitters.created_at)+'</span></li>'); } document.getElementById('twitter_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 'Just'; } else if(delta < 120) { return '1Minutes ago'; } else if(delta < (60*60)) { return (parseInt(delta / 60)).toString() + ' minutes ago'; } else if(delta < (120*60)) { return '1Hours ago'; } else if(delta < (24*60*60)) { return + (parseInt(delta / 3600)).toString() + ' hours ago'; } else if(delta < (48*60*60)) { return '1 days ago'; } else { return (parseInt(delta / 86400)).toString() + ' days ago'; } } //--> </script> <script src="http://www.davidtao.cn/twitter/jsonp.php?callback=getTwitter&username=davidztao&count=6" type="text/javascript"></script>
郑桐麒溢
8PT6q8ZF2
雷蜻燕晶
biku9rWn
nivphhrdj89
dssf56yh8
gcjp1yXn
adminadmina
汤拉玄