|
Project Information
Links
|
jQuery Twitter API aims to give Web developers the ability to request Twitter public informations from a simple JavaScript function call. See Twitter API for more information http://apiwiki.twitter.com/. NB : informations requiring authentication are not accessible to JavaScript inside classical Web pages because of the same origin policy restriction Methods can be of two forms depending on the type of requests :
The parameters are :
Usage example//Test Twitter : should return OK
$.twitter.test(printSuccess);
//Search methods
$.twitter.search("test",printSuccess);
$.twitter.search.user("sroucheray",printSuccess);
$.twitter.search.repliesTo("sroucheray",printSuccess);
$.twitter.search.mentioned("sroucheray",printSuccess);
$.twitter.search.hashtag("35days",printSuccess);
//Trends methods
$.twitter.trends.current(printSuccess);
$.twitter.trends.daily(printSuccess);
$.twitter.trends.weekly(printSuccess);
//Public methods
$.twitter.statuses.publicTimeline(printSuccess);
$.twitter.statuses.show("123", printSuccess);
$.twitter.statuses.friends("42421507", printSuccess);
//Social Graph methods
$.twitter.friends.ids("123", printSuccess);
$.twitter.followers.ids("123", printSuccess);
//Twitter API limitation check
$.twitter.account.rateLimitStatus(printSuccess);
function printSuccess(data, textStatus){
//Handle data as a JSON object
}JSONP and jQueryTo work, the jQuery Twitter API need to use JSONP callback. By default, jQuery badly handle error when using AJAX request with JSONP callback. Including, the JSONP for jQuery extension before calling any jQuery Twitter API method will better handle error fallback without changing the API behavior. (Not including it will let the API works with the standards jQuery AJAX request). |