You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Post a status * * @param {User} user, oauth user. * @param {String|Object} status * - {String} status, content text. * - {Number} [lat], latitude. * - {Number} [long], longitude. * - {String} [annotations], addtional information. * @param {Function(Error, Status)} callback * @return {Context} this */update(user,status,callback)
upload
/** * Post a status contain an image. * * @param {User} user, oauth user. * @param {String|Object} status * - {String} status, content text. * - {Number} [lat], latitude. * - {Number} [long], longitude. * - {String} [annotations], addtional information. * @param {Object} pic * - {Buffer|ReadStream} data * - {String} [name], image file name * - {String} [content_type], data content type * - {Function(info)} [progress], upload progress callback. * - {Object} info: {total: total Size, loaded: upload Size}. * @param {Function(Error, Status)} callback * @return {Context} this */upload(user,status,pic,callback)
repost
/** * Repost a status. * * @param {User} user * @param {String|Number} id, need to repost status id. * @param {String|Object} status * - {String} status, content text * - {Number} [lat], latitude. * - {Number} [long], longitude. * - {Boolean} isComment, is comment or not, default is `false`. * @param {Function(Error, Status)} callback * @return {Context} this */repost(user,id,status,callback)
destroy
/** * Remove a status by id. * * @param {User} user * @param {String|Number} id * @param {Function(Error, Status)} callback * @return {Context} this */destroy(user,id,callback)
show
/*** Get a status by id.* * @param {User} user* @param {String|Number} id* @param {Function(Error, Status)} callback* @return {Context} this*/show(user,id,callback)
/** * Get user profile infomation by access token. * * @param {Object} user * - {String} blogtype * - {String} oauth_token, access oauth token * - {String} [oauth_token_secret], access oauth token secret, oauth v2 don't need this param. * @param {Function(err, User)} callback * @return {Context} this */verify_credentials: function(user,callback)
user_show
/** * Get user profile infomation by uid or screen_name. * * @param {Object} user * - {String} blogtype * - {String} oauth_token, access token * - {String} [oauth_token_secret], access oauth token secret, oauth v2 don't need this param. * @param {String} [uid], user id * @param {String} [screen_name], user screen_name * uid and screen_name MUST set one. If set both, will use `screen_name`. * `tqq` do not support `screen_name`. * @param {Function(err, User)} callback * @return {Context} this */user_show: function(user,uid,screen_name,callback)
/*** List comments to me* * @param {User} user* @param {Cursor} [cursor]* - {String} [since_id]* - {String} [max_id]* - {Number} [count], default is `20`* - {Number} [page]* - {Number} [filter_by_author], only support by `weibo`;* Filter comments by author type, 0: all, 1: I following, 2: stranger, default is `0`.* - {Number} [filter_by_source], only support by `weibo`;* Filter comments by source type, 0: all, 1: come from weibo, 2: come from weiqun, default is `0`.* @param {Function(err, result)} callback* {Object} result:* - {Array} items, [Comment, ...]* - {Cursor} cursor* - ...* @return {Context} this*/comments_to_me: function(user,cursor,callback)
comments_by_me
/*** List comments post by me* * @param {User} user* @param {Cursor} [cursor]* - {String} since_id* - {String} max_id* - {Number} count, default is `20`* - {Number} page* - {Number} [filter_by_source], only support by `weibo`;* Filter comments by source type, 0: all, 1: come from weibo, 2: come from weiqun, default is `0`.* @param {Function(err, result)} callback* {Object} result:* - {Array} items, [Comment, ...]* - {Cursor} cursor* - ...* @return {Context} this*/comments_by_me: function(user,cursor,callback)
comments
/** * List one status's comments * * @param {User} user * @param {String} id, status's id * @param {Cursor} [cursor] * - {String} since_id * - {String} max_id * - {String} [since_time], only for tqq * - {String} [max_time], only for tqq * - {Number} count, default is `20` * - {Number} page * - {Number} [filter_by_author], 0: all, 1: only I following、2: stranger, default is `0`. * @param {Function(err, result)} callback * {Object} result: * - {Array} items, [Comment, ...] * - {Cursor} cursor * - ... * @return {Context} this */comments(user,id[,cursor],callback){
comment_create
/** * post a comment to a status * * @param {AccessToken} user * @param {String} id, status's id * @param {String|Object} comment * - {String} comment * - {Number} [comment_ori], same comment to the original status when comment on a repost status, * 0: no, 1: yes, default is `0`. * @param {Function(err, result)} callback * - {Object} result * - {String} id, the comment id * @return {Context} this */comment_create: function(user,id,comment,callback)
comment_reply
/** * reply to a comment * @param {AccessToken} user * @param {String} cid, comment's id * @param {String} id, status's id * @param {String|Object} comment * - {String} comment * - {Number} [without_mention], auto add `'reply@username'` to comment text or not, * 0: yes, 1: no, default is `1`, won't auto add. * - {Number} [comment_ori], same comment to the original status when comment on a repost status, * 0: no, 1: yes, default is `0`. * @param {Function(err, result)} callback * @return {Context} this */comment_reply: function(user,cid,id,comment,callback)
comment_destroy
/** * remove a comment * @param {AccessToken} user * @param {String} cid, comment's id * @param {Function(err, result)} callback * @return {Context} this */
comment_destroy: function(user,cid,callback){
Favorite APIs
favorites
/** * List favorites. * * @param {User} user * @param {Cursor} [cursor] * - {String} since_id * - {String} max_id * - {String} [since_time], only for tqq * - {String} [max_time], only for tqq * - {Number} count, default is `20` * - {Number} page * @param {Function(err, result)} callback * {Object} result: * - {Array} items, [Favorite, ...] * - {Cursor} cursor * - ... * @return {Context} this */favorites: function(user,cursor,callback)
favorite_show
/** * Show a favorite item by item id. * * @param {User} user * @param {String} id, favorite item's id. * @param {Function(err, favorite)} callback * @return {Context} this */favorite_show: function(user,id,callback)
favorite_create
/** * Add a status to favorites. * * @param {User} user * @param {String} id, status's id. * @param {Function(err, result)} callback * - {Object} result * - {String} id, relation item's id. * - addtional infomation maybe. * @return {Context} this */favorite_create: function(user,id,callback)
favorite_destroy
/** * Remove the status from favorites. * * @param {User} user * @param {String} id, the favorite item's id. * @param {Function(err, result)} callback * - {Object} result * - {String} id, relation item's id. * - addtional infomation maybe. * @return {Context} this */favorite_destroy: function(user,id,callback)
Message APIs
direct_messages_both
/** * Returns the direct messages, sent to and sent by the authenticating user. * * @param {User} user * @param {Object} cursor, pagging params. * - {Number} [count], Specifies the number of records to retrieve. * - {String} [since_id], Returns results with an ID greater than (that is, more recent than) the specified ID. * - {String} [since_time], only for tqq * - {String} [max_id], Returns results with an ID less than (that is, older than) the specified ID. * - {String} [max_time], only for tqq * - {Number} [page], Specifies the page of results to retrieve. * - {Boolean} [include_entities], The entities node will not be included when set to `false`. * - {Boolean} [skip_status], When set to either true, t or 1 statuses will not be included in the returned user objects. * @param {Function(err, result)} callback */direct_messages_both: function(user,cursor,callback)
direct_messages
/** * Returns the 20 most recent direct messages sent to the authenticating user. * * @param {User} user * @param {Object} cursor, pagging params. * - {Number} [count], Specifies the number of records to retrieve. * - {String} [since_id], Returns results with an ID greater than (that is, more recent than) the specified ID. * - {String} [since_time], only for tqq * - {String} [max_id], Returns results with an ID less than (that is, older than) the specified ID. * - {String} [max_time], only for tqq * - {Number} [page], Specifies the page of results to retrieve. * - {Boolean} [include_entities], The entities node will not be included when set to `false`. * - {Boolean} [skip_status], When set to either true, t or 1 statuses will not be included in the returned user objects. * @param {Function(err, result)} callback */direct_messages: function(user,cursor,callback)
direct_messages_sent
/** * Returns the 20 most recent direct messages sent by the authenticating user. * * @param {User} user * @param {Object} cursor, pagging params. * - {Number} [count], Specifies the number of records to retrieve. * - {String} [since_id], Returns results with an ID greater than (that is, more recent than) the specified ID. * - {String} [since_time], only for tqq * - {String} [max_id], Returns results with an ID less than (that is, older than) the specified ID. * - {String} [max_time], only for tqq * - {Number} [page], Specifies the page of results to retrieve. * - {Boolean} [include_entities], The entities node will not be included when set to `false`. * @param {Function(err, result)} callback */direct_messages_sent: function(user,cursor,callback)
direct_message_show
/** * Returns a single direct message, specified by an id parameter. * @param {User} user * @param {String} id, The ID of the direct message. * @param {Function(err, message)} callback */direct_message_show: function(user,id,callback)
direct_message_create
/** * Sends a new direct message to the specified user from the authenticating user. * @param {User} user * @param {Object} toUser, One of uid or screen_name are required. * - {String} uid, The ID of the user who should receive the direct message. * - {String} screen_name, The screen name of the user who should receive the direct message. * @param {String} text, The text of your direct message. Be sure to URL encode as necessary. * @param {Function(err, result)} callback */direct_message_create: function(user,toUser,text,callback)
direct_message_destroy
/** * Destroys the direct message specified in the required ID parameter. * @param {User} user * @param {String} id, The ID of the direct message to delete. * @param {Function(err, result)} callback */direct_message_destroy: function(user,id,callback)
Data Structure
Status
Tweet in Twitter.
Field name
Data Type
Description
Demo
id
String
ID
'3335688'
t_url
String
Status unity url
'http://weibo.com/1577826897/yDH17Ex4f'
created_at
Date
Status create datetime
new Date('Wed Sep 26 2012 19:18:39 GMT+0800 (CST)')
{"target": {"id": 1418348195,"screen_name": "zaku","followed_by": false,// followed by source"following": false,// following the source"notifications_enabled": false},"source": {"id": 1734528095,"screen_name": "檀木幻想","followed_by": false,// followed by target"following": false,// following the target"notifications_enabled": false}}