jQuery Howto's Tweets

Getting your tweets...

You can get tweets for:

Use CSS and your own HTML markup to style your tweets.

Don't forget, returned results have more details about the post.
Ex: Post date, user profile image, from where it was posted, etc.

Markup

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jtwitter.js"></script>

<script type="text/javascript">
$(document).ready(function(){
    // Get latest 6 tweets by jQueryHowto
    $.jTwitter('jQueryHowto', 10, function(data){
        $('#posts').empty();
        $.each(data, function(i, post){
            $('#posts').append(
                '<div class="post">'
                +' <div class="txt">'
                // See output-demo.js file for details
                +    post.text
                +' </div>'
                +'</div>'
            );
        });
    });
});
</script>

</head>
<body>
	<h1>jQuery Howto's Tweets</h1>
	<div id="posts">Getting your tweets...</div>
</body>
</html>

The generated HTML markup will look like this:

<div id="posts">
  <div class="post">
    Tweet text 1
  </div>
  <div class="post">
    Tweet text 2
  </div>
  <div class="post">
    Tweet text 3
  </div>
  <div class="post">
    ...
  </div>
</div>

jQuery Tweeter plugin homepage.


« Other demos