A jQuery plugin that displays tweet(s) on your site, blog or wathever
A jQuery plugin that displays tweet(s) on your site, blog or wathever. It's easy to use. It will auto format the hash tag, links and name.
You can load as many accounts at the time you like with this plugin. It will give every account it load a unique id.
Note It will do one request to the Twitter API for each account.
This will load one tweet (include rts) from the username you specified and show it.
$('.tweet').tweet('frozzare');
<ul class="tweets">Loading tweets</ul>
$('.tweets').tweet({
screen_name: 'frozzare',
list: true,
count: 5
});
<ul class="tweets">Loading tweets</ul>
$('.tweet').tweet({
screen_name: 'frozzare',
avatar: true,
list: true,
count: 5
});
<p class="tweet"><img src="…"> tweet</p>
<p class="tweet">Loading tweets</p>
$('.tweet').tweet({ id: '194120642130477056' });
Or you can use the shortcut string
$('.tweet').tweet('id:194120642130477056');
Each object created by $().tweet
function will be stored in the window.tweets
object.
$.tweet.get
is used to load every tweet stored in window.tweets
for a user. It will return an object or array depending on the amount of tweets.
$.tweet.get('frozzare')
// => Tweet
$.tweet.get('frozzare')
// => [Tweet, Tweet]
npm install -g grunt
make
0.6.1 - Rewritten relative_time function, removing some unnecessary code, changing callback functions and renamed $.getTweet to $.tweet.get. $.tweet.get only returns object or array with tweet(s) now. $.tweet prepares a bit for the next version.
Using $.each instead of for loop. Every element will get an data-tweet attribute with the tweet id. The guid will not start with 'tweet' anymore only 't' and a timestamp.
Added some css to the examples.
0.6 - Adding build system, Tweet id options, fixing radix errors
0.5 - First release