jQuery LiveTweet is a jquery plugin that fetches tweets from Twitter.
<script src="jquery.js"></script>
<script src="jquery.livetweet.js"></script>
<script>
$(document).ready(function() {
$('#your_element').livetweet({
'username' : 'twitter_user'
});
});
</script>
- username: Your twitter username. Defaults to
jeresig
(jQuery’s creator). - limit: Number of tweets returned. Defaults to
5
. - timeout: Request timeout. Defaults to
2000
(2 seconds). - html_before: HTML to be rendered before tweets’ loop. Defaults to
<ul>
. - html_after: HTML to be rendered after tweets’ loop. Defaults to
</ul>
. - html_tweets: HTML pattern for tweets. Defaults to
<li>{text}<br>{date}</li>
. - use_relative_dates: Boolean. Uses relative dates (ie:
2 minutes ago
). Defaults totrue
. - format_date: Date formatting function. Use it if you set relative dates to false. Defaults to a date like
Wednesday 12 March 2011
. - lang: Language for dates and messages. Currently supported languages are
en, id, it, fr
. Defaults toen
.
$("#your_element").livetweet({
'username' : 'sergio_martino',
'html_before' : 'These are my tweets:<br>',
'html_tweets' : '{date} | {text}<br>',
'html_after' : '<br>Hello!'
});
$("#your_element").livetweet({
'username' : 'sergio_martino',
'html_before' : 'These are my tweets:<br>',
'html_tweets' : '{date} | {text}<br>',
'html_after' : '<br>Hello!',
'lang': 'it',
'use_relative_dates' : false,
'format_date' : function(js_date_object) {
return my_date.getDay()+'/'+my_date.getMonth()+'/'+my_date.getFullYear();
}
});