Last active
December 10, 2015 08:18
-
-
Save krasimir/4406250 to your computer and use it in GitHub Desktop.
Get your latest Twitter activity
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
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