开发者

how do i limit the number of tweets to one using jquery

i am trying to display just the most recent tweet on my home page i see a working example however it is not limited to one how do i make this return just one tweet?

example: http://jsfiddle.net/pb开发者_如何学Correli/pJgyu/

Thanks


If you change your code to -

   $(function(){ 
    $('#tweets').tweet({
           count: 1,
           username: "jquery"
    });
   });

And your external reference in jsfiddle to -

http://tweet.seaofclouds.com/jquery.tweet.js

Then it should work.

http://jsfiddle.net/zSLWt/1/


You can use another jquery twitter plugin

Steps:

Add a markup

<div id="twitter"> 
   results will be here
</div> 

Call plugin method like

<script type="text/javascript"> 
        $(document).ready(function() {
            $("#twitter").getTwitter({
                userName: "jquery",
                numTweets: 5,
                loaderText: "Loading tweets...",
                slideIn: true,
                slideDuration: 750,
                showHeading: true,
                headingText: "Latest Tweets",
                showProfileLink: true,
                showTimestamp: true
            });
        });
    </script> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜