Created
June 12, 2010 11:28
-
-
Save pwlin/435648 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(''); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment