Skip to content

Instantly share code, notes, and snippets.

@atypical
Created October 29, 2011 21:46
Show Gist options
  • Save atypical/1325136 to your computer and use it in GitHub Desktop.
Save atypical/1325136 to your computer and use it in GitHub Desktop.
example
userTimeline: function (screenName, sinceId, success, failure, options)
{
options = options || {};
var url = OAuth.Twitter.API_URL +
OAuth.Twitter.API_VERSION +
OAuth.Twitter.API_USER_TIMELINE + '.' +
OAuth.Twitter.API_FORMAT;
var userId = parseInt(screenName, 10);
if (userId == screenName)
{
options.userId = userId;
}
else
{
options.screenName = screenName;
}
var allowed_options = {
'screenName': 'screen_name',
'userId': 'user_id',
'count': 'count',
'page': 'page',
'maxId': 'max_id',
'trimUser': 'trim_user',
'includeRetweets': 'include_rts',
'includeEntities': 'include_entities',
'excludeReplies': 'exclude_replies',
'contributorDetails': 'contributor_details'
};
var defaults = {
'trimUser': true,
'includeRetweets': true,
'includeEntities': true,
'excludeReplies': false,
'contributorDetails': true
};
url += optionsToQueryString(options, allowed_options, defaults);
this.oauth.getJSON(url, success, failure);
return this;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment