Skip to content

Instantly share code, notes, and snippets.

@krasimir
Last active December 10, 2015 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krasimir/4406250 to your computer and use it in GitHub Desktop.
Save krasimir/4406250 to your computer and use it in GitHub Desktop.
Get your latest Twitter activity
var Twitter = (function() {
var feed = function(userId, callback, count) {
var url = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=" + userId + "&count=" + (count || 10);
$.ajax({
url: url,
dataType: 'jsonp',
success: function(results) {
callback(null, results);
},
error: function() {
callback({message: "Can't read data from " + url})
}
});
}
return {
feed: feed
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment