Twidget retrieves recent tweets from any user's public Twitter timeline, parses links, marks them up then places them in an element on the page.
Reference the Twidget module in your html page
<script type="text/javascript" charset="utf-8" src="js/Twidget.js"></script>
Put an element into your HTML to hold/display the tweets
<div id="tweets"></div>
Instantiate a Twidget object once the domready event has been fired:
window.addEvent("domready", function(){ new Twidget({ user: "mootools", count : "5" }); });
new Twidget([options]);
1. options - (object, optional) the options described below:
<p class="tweet">This is a <a href="http://search.twitter.com/search?q=%23tweet">#tweet</a> that mentions <a href="http://twitter.com/mootools">@mootools</a> <a href="http://mootools.net">http://mootools.net</a>.<span class="when">3 days ago</span></p>
If the Tweetify module is available Twidget will use it to construct the links, so change Tweetify if you have it installed.
If Tweetify is not available Twidget will use its own internal method linkify. In that case simply extend Twidget and write your own linkify method.
Twidget will wrap all links in a p element with a "tweet" class. The time/date, relative to now, when the tweet was created will be appended to the end of the tweet and wrapped in a span element with a "when" class.
The element described above are added by the internal markup method, so to change the markup, just extend Twidget and write your own markup method.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus