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>
精彩评论