Skip to content

Instantly share code, notes, and snippets.

@voxxit
Created August 27, 2010 14:28
Show Gist options
  • Select an option

  • Save voxxit/553451 to your computer and use it in GitHub Desktop.

Select an option

Save voxxit/553451 to your computer and use it in GitHub Desktop.
T.User.find("voxxit").timeline().first(5).each(function(tweet){
if(tweet.text !== undefined){
var tweet_html = '<div class="tweet">';
var link_regex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
tweet_html += tweet.text.replace(link_regex, '<a href="$1">$1</a>');
tweet_html += '<div class="tweet_hours">';
tweet_html += '<a href="http://www.twitter.com/';
tweet_html += 'voxxit/status/' + tweet.id + '">';
tweet_html += '<time>' + time_ago_in_words(tweet.createdAt) + ' ago</time><\/a><\/div>';
tweet_html += '<\/div>';
$('#tweet-container').append(tweet_html);
T(tweet_html).linkifyUsers();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment