JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<body>
<ul id="tweets"></ul>
</body>
CSS
.austintexasgov { color: #800000;}
.greenling_com { color: #008000;}
.themomandpops { color: #0000FF;}
JavaScript
$(function(){
$.when( getTweets('austintexasgov'),
getTweets('greenling_com'),
getTweets('themomandpops')
).done(function(atxArgs, greenlingArgs, momandpopsArgs){
var allTweets = [].concat(atxArgs[0]).concat(greenlingArgs[0]).concat(momandpopsArgs[0]);
var sortedTweets = sortTweets(allTweets);
showTweets(sortedTweets);
});
});
var getTweets = function(user){
var url='http://twitter.com/status/user_timeline/' + user + '.json';
return $.get(url, {count:5}, null, 'jsonp');
}
var showTweets = function(tweets){
$.each(tweets, function(){
$("#tweets").append( '<li class="'+ this.user.screen_name+'">' +
this.user.screen_name +': ' + this.text + '</li>' );
});
};
var sortTweets = function(tweets){
return _.sortBy(tweets, function(t){ return t.text });
}