Skip to content

Instantly share code, notes, and snippets.

@javierguerrero
Created April 16, 2015 12:51
Show Gist options
  • Save javierguerrero/9c0155e42720db74e169 to your computer and use it in GitHub Desktop.
Save javierguerrero/9c0155e42720db74e169 to your computer and use it in GitHub Desktop.
$.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');
}
// see it in action at http://jsfiddle.net/94PGy/4/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment