jQuery: using jTwitter on a Twitter feed

jTwitter is a powerful jQuery plugin created to parse a Twitter feed in JSON format. This plugin adds a new global function to the jQuery wrapper and encapsulates the popular global getJSON() method. Also, this plugin allow us to limit the number of tweets returned by the JSON object obtained by the AJAX request (performed using the JSONP standard). Further, we can work on the single properties of such an object by iterating over them using $.each(). An example:

 $.jTwitter('username', 5, function(data){
  $.each(data, function(i, post){
   var tweet = post.text;
    '<div class="post">'
    +' <div class="txt">'
    +    tweet
    +' </div>'


As you can see, this plugin accepts a Twitter username, the number of returned tweets and the JSON object itself.


Live demo

Leave a Reply

Note: Only a member of this blog may post a comment.