Hi MooTools pals.

Here I bring to you a class that hopefully will make your life easier,
it extends the Rquest.JSONP class so proving the power of MooTools as
a nice OOP javascript framework.

This class file is posted at forums:
http://www.mooforum.net/script-showcase-f25/modified-twitter-request-t3782.html

How to implement it:

[CODE]
var twitterRequest = new RequestTwitter({
        parameters: {
            screen_name: 'quillamwa' // The twitter user account to
get tweets from.
        }
    });

twitterRequest.addEvent('complete', function(tweets) {
        alert('Request completed');
        tweets.each(function(tweet, index) {
            // Do something with each tweet. Usually here, you may
create elements and inject them to DOM.
       // If you are only interested in tweets text, go for tweet.text
here.
        });
    });

// Don't forget to add the onComplete event before making the request,
because twitter answers really fast  hehehe.
twitterRequest.send();

[/CODE]

And also has some custom methods I added it to make it helpfull:

- updateParams(params, apiversion)
- deleteParams('param1', 'param2',...)
- changeUser('other-twitter-user-account')
- changeVersion(APIVersion)

Merry christmass,
Ciul

Reply via email to