=^.^=
Thanks Kelvin for the compliment
Yeah, it is kinda messy, in the code comments I say sorry for
that :P,
what I tried to do there was not passing parameters as null so
Twitter
API use default values for those.
Also note that I use Twitter API real names, other implementations
were adding the username to the url to request from, while it works,
Twitter recommend using the screen_name parameters, passing it to the
request.
One improvement is, to request tweets from different users, you just
have to use the changeUser('othertwitteruser') method and then use
send( ) again and that's it.
Note that link parameter is 'chain' by default so you could do
several
send calls and they will be chained :)On 28 dic, 08:02, Kelvin <[email protected]> wrote: > It looks like one of the best Twitter implementations for MooTools out > there. Extending Request.JSONP is brilliant. Not sure about the params > part, seems a little messy, but hey if it works, who cares no? ;-) > > I'll check it out later today. > > On Dec 25, 12:55 pm, Ciul <[email protected]> wrote: > > > > > > > > > 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-... > > > 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
