PHP Class SaeTClientV2, libweibo

Mostrar archivo Open project: xiaosier/libweibo Class Usage Examples

Public Methods

Method Description
__construct ( mixed $akey, mixed $skey, mixed $access_token, mixed $refresh_token = NULL ) : void 构造函数
account_career ( integer $uid = NULL ) : array 获取用户的职业信息
account_career_batch ( string $uids ) : array 批量获取用户的职业信息
account_education ( integer $uid = NULL ) : array 获取用户的教育信息
account_education_batch ( string $uids ) : array 批量获取用户的教育信息
account_profile_basic ( integer $uid = NULL ) : array 获取用户基本信息
add_tags ( mixed $tags ) : array 为当前登录用户添加新的用户标签
add_to_favorites ( integer $sid ) : array 收藏一条微博信息
bilateral ( integer $uid, integer $page = 1, integer $count = 50, integer $sort ) : array 获取用户的双向关注列表,即互粉列表
bilateral_ids ( integer $uid, integer $page = 1, integer $count = 50, integer $sort ) : array 获取用户的双向关注uid列表
car_destroy ( integer $id ) : array 根据公司ID删除用户的职业信息
car_update ( array $car_update ) : array 设置职业信息
comment_destroy ( integer $cid ) : array 删除当前用户的微博评论信息。
comment_destroy_batch ( string $ids ) : array 根据评论ID批量删除评论
comments_by_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_source ) : array 获取当前登录用户所发出的评论列表
comments_daily ( integer $count = 20, integer $base_app ) : array 按天返回热门微博评论榜的微博列表
comments_mentions ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source ) : array 获取最新的提到当前登录用户的评论,即@我的评论
comments_show_batch ( string $cids ) : array 根据评论ID批量返回评论信息
comments_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array 最新评论(按时间)
comments_to_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source ) : array 获取当前登录用户所接收到的评论列表
comments_weekly ( integer $count = 20, integer $base_app ) : array 按周返回热门微博评论榜的微博列表
daily_trends ( integer $base_app ) : array 返回最近一天内的热门话题
delete ( integer $id ) : array 删除一条微博
delete_dm ( integer $did ) : array 删除一条私信
delete_dms ( mixed $dids ) : array 批量删除私信
delete_tag ( integer $tag_id ) : array 删除标签
delete_tags ( mixed $ids ) : array 批量删除标签
destroy ( integer $id ) : array 删除一条微博
dm_conversation ( integer $uid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array 获取与指定用户的往来私信列表
dm_show_batch ( string $dmids ) : array 根据私信ID批量获取私信内容
dm_user_list ( integer $count = 20, integer $cursor ) : array 获取与当前登录用户有私信往来的用户列表,与该用户往来的最新私信
domain_show ( mixed $domain ) : array 通过个性化域名获取用户资料以及用户最新的一条微博
edu_destroy ( integer $id ) : array 根据学校ID删除用户的教育信息
edu_update ( array $edu_update ) : array 设置教育信息
emotions ( string $type = "face", string $language = "cnname" ) : array 获取表情列表
favorites_by_tags ( integer $tid, integer $page = 1, integer $count = 50 ) : array 根据标签获取当前登录用户该标签下的收藏列表
favorites_show ( integer $id ) : array 根据收藏ID获取指定的收藏信息
favorites_tags ( integer $page = 1, integer $count = 50 ) : array 获取当前登录用户的收藏标签列表
favorites_tags_destroy_batch ( integer $tid ) : array 删除当前登录用户所有收藏下的指定标签
favorites_tags_update ( integer $id, string $tags ) : array 更新一条收藏的收藏标签
favorites_update_batch ( integer $tid, string $tag ) : array 更新当前登录用户所有收藏下的指定标签
follow_by_id ( integer $uid ) : array 关注一个用户。
follow_by_name ( string $screen_name ) : array 关注一个用户。
follow_create_batch ( string $uids ) : array 根据用户UID批量关注用户
follow_trends ( string $trend_name ) : array 关注某话题
followers_active ( integer $uid, integer $count = 20 ) : array 获取优质粉丝
followers_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array 获取用户的粉丝列表
followers_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array 获取用户的粉丝列表
followers_ids_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array 获取用户的粉丝列表uid
followers_ids_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array 获取用户的粉丝列表uid
friends_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array 获取用户的关注列表
friends_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array 获取用户的关注列表
friends_chain_followers ( integer $uid, integer $page = 1, integer $count = 50 ) : array 获取当前登录用户的关注人中又关注了指定用户的用户列表
friends_ids_by_id ( integer $uid, integer $cursor, integer $count = 500 ) : array 获取用户的关注列表uid
friends_ids_by_name ( string $screen_name, integer $cursor, integer $count = 500 ) : array 获取用户的关注列表uid
friends_in_common ( integer $uid, integer $suid = NULL, integer $page = 1, integer $count = 50 ) : array 获取两个用户之间的共同关注人列表
friends_remark_batch ( string $uids ) : array 批量获取当前登录用户的关注人的备注信息
friends_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $base_app, integer $feature ) : array 获取当前登录用户及其所关注用户的最新微博消息。
get_comments_by_sid ( integer $sid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author ) : array 根据微博ID返回某条微博的评论列表
get_favorites ( integer $page = 1, integer $count = 50 ) : array 获取当前用户的收藏列表
get_privacy ( ) : array 获取隐私信息设置情况
get_suggest_tags ( integer $count = 10 ) : array 返回用户感兴趣的标签
get_tags ( integer $uid = NULL, integer $page = 1, integer $count = 20 ) : array 返回指定用户的标签列表
get_tags_batch ( string $uids ) : array 批量获取用户的标签列表
get_trends ( integer $uid = NULL, integer $page = 1, integer $count = 10 ) : array 获取某用户的话题
get_uid ( ) : array OAuth授权之后,获取授权用户的UID
home_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $base_app, integer $feature ) : array 获取当前登录用户及其所关注用户的最新微博消息。
hot_favorites ( integer $page = 1, integer $count = 20 ) : array 热门收藏
hot_users ( string $category = "default" ) : array 获取系统推荐用户
hourly_trends ( integer $base_app ) : array 返回最近一小时内的热门话题
is_followed_by_id ( mixed $target_id, mixed $source_id = NULL ) : array 返回两个用户关系的详细情况
is_followed_by_name ( mixed $target_name, mixed $source_name = NULL ) : array 返回两个用户关系的详细情况
list_dm ( integer $page = 1, integer $count = 50, int64 $since_id, int64 $max_id ) : array 获取当前用户最新私信列表
list_dm_sent ( integer $page = 1, integer $count = 50, int64 $since_id, int64 $max_id ) : array 获取当前用户发送的最新私信列表
mentions ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source, integer $filter_by_type ) : array 获取@当前用户的微博列表
public_timeline ( integer $page = 1, integer $count = 50, integer $base_app ) : array 获取最新的公共微博消息
put_users_not_interested ( integer $uid ) : array 把某人标识为不感兴趣的人
queryid ( integer | string $mid, integer $type = 1, integer $is_batch, integer $inbox, integer $isBase62 ) : array 通过微博(评论、私信)MID获取其ID
querymid ( integer | string $id, integer $type = 1, integer $is_batch ) : array 通过微博(评论、私信)ID获取其MID
rate_limit_status ( ) : array 获取当前登录用户的API访问频率限制情况
remove_from_favorites ( integer $id ) : array 删除微博收藏。
remove_from_favorites_batch ( mixed $fids ) : array 批量删除微博收藏。
reply ( integer $sid, string $text, integer $cid, integer $without_mention, integer $comment_ori ) : array 回复一条评论
repost ( integer $sid, string $text = NULL, integer $is_comment ) : array 转发一条微博信息。
repost_by_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array 获取当前用户最新转发的n条微博消息
repost_daily ( integer $count = 20, integer $base_app ) : array 按天返回热门微博转发榜的微博列表
repost_timeline ( integer $sid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author ) : array 返回一条原创微博消息的最新n条转发微博消息。本接口无法对非原创微博进行查询。
repost_weekly ( integer $count = 20, integer $base_app ) : array 按周返回热门微博转发榜的微博列表
school_list ( array $query ) : array 获取所有的学校列表
search_at_users ( string $q, integer $count = 10, integer $type, integer $range = 2 ) : array @用户时的联想建议
search_companies ( string $q, integer $count = 10 ) : array 搜索公司时的联想搜索建议
search_schools ( string $q, integer $count = 10, $type = 1 ) : array 搜索学校时的联想搜索建议
search_statuses ( string $q, integer $count = 10 ) : array 搜索微博时的联想搜索建议
search_statuses_high ( array $query ) : array 搜索与指定的一个或多个条件相匹配的微博
search_users ( string $q, integer $count = 10 ) : array 搜索用户时的联想搜索建议
search_users_keywords ( array $query ) : array 通过关键词搜索用户
send_comment ( integer $id, string $comment, integer $comment_ori ) : array 对一条微博进行评论
send_dm_by_id ( integer $uid, string $text, integer $id = NULL ) : array 发送私信
send_dm_by_name ( string $screen_name, string $text, integer $id = NULL ) : array 发送私信
set_debug ( boolean $enable ) : void 开启调试信息
set_remote_ip ( string $ip ) : boolean 设置用户IP
show_batch ( string $ids ) : array 根据微博id号获取微博的信息
show_status ( integer $id ) : array 根据ID获取单条微博信息内容
show_user_by_id ( integer $uid ) : array 根据用户UID或昵称获取用户资料
show_user_by_name ( string $screen_name ) : array 根据用户UID或昵称获取用户资料
suggestions_may_interested ( integer $page = 1, integer $count = 10 ) : array 获取用户可能感兴趣的人
suggestions_users_by_status ( string $content, integer $num = 10 ) : array 根据一段微博正文推荐相关微博用户。
timeline_batch_by_id ( string $uids, integer $page = 1, integer $count = 50, integer $feature, integer $base_app ) : array 批量获取指定的一批用户的timeline
timeline_batch_by_name ( string $screen_name, integer $page = 1, integer $count = 50, integer $feature, integer $base_app ) : array 批量获取指定的一批用户的timeline
trends_is_follow ( string $trend_name ) : array 判断当前用户是否关注某话题
unfollow_by_id ( integer $uid ) : array 取消关注某用户
unfollow_by_name ( string $screen_name ) : array 取消关注某用户
unfollow_trends ( integer $tid ) : array 取消对某话题的关注
update ( string $status, float $lat = NULL, float $long = NULL, mixed $annotations = NULL, integer $visible ) : array 发表微博
update_privacy ( array $privacy_settings ) : array 设置隐私信息
update_profile ( array $profile ) : array 更改用户资料
update_profile_image ( string $image_path ) : array 更改头像
update_remark ( integer $uid, string $remark ) : array 更新当前登录用户所关注的某个好友的备注信息
upload ( string $status, string $pic_path, float $lat = NULL, float $long = NULL, integer $visible ) : array 发表图片微博
upload_url_text ( string $status, string $url, integer $visible, string $list_id = NULL, string $pic_id = NULL, float $lat = NULL, float $long = NULL, string $annotations = NULL ) : array 指定一个图片URL地址抓取后上传并同时发布一条新微博
user_timeline_by_id ( mixed $uid = NULL, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $feature, integer $trim_user, integer $base_app ) : array 获取用户发布的微博信息列表
user_timeline_by_name ( string $screen_name = NULL, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $feature, integer $trim_user, integer $base_app ) : array 获取用户发布的微博信息列表
users_show_batch_by_id ( string $uids ) : array 批量获取用户信息按uids
users_show_batch_by_name ( string $screen_name ) : array 批量获取用户信息按screen_name
verify_nickname ( string $nickname ) : array 验证昵称是否可用,并给予建议昵称
weekly_trends ( integer $base_app ) : array 返回最近一周内的热门话题

Protected Methods

Method Description
id_format ( &$id )
request_with_pager ( $url, $page = false, $count = false, $params = [] )
request_with_uid ( $url, $uid_or_name, $page = false, $count = false, $cursor = false, $post = false, $params = [] )

Method Details

__construct() public method

构造函数
public __construct ( mixed $akey, mixed $skey, mixed $access_token, mixed $refresh_token = NULL ) : void
$akey mixed 微博开放平台应用APP KEY
$skey mixed 微博开放平台应用APP SECRET
$access_token mixed OAuth认证返回的token
$refresh_token mixed OAuth认证返回的token secret
return void

account_career() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/career account/profile/career}
public account_career ( integer $uid = NULL ) : array
$uid integer 需要获取教育信息的用户UID,默认为当前登录用户。
return array

account_career_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/career_batch account/profile/career_batch}
public account_career_batch ( string $uids ) : array
$uids string 需要获取教育信息的用户UID,用半角逗号分隔,最多不超过20。
return array

account_education() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/education account/profile/education}
public account_education ( integer $uid = NULL ) : array
$uid integer 需要获取教育信息的用户UID,默认为当前登录用户。
return array

account_education_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/education_batch account/profile/education_batch}
public account_education_batch ( string $uids ) : array
$uids string 需要获取教育信息的用户UID,用半角逗号分隔,最多不超过20。
return array

account_profile_basic() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/basic account/profile/basic}
public account_profile_basic ( integer $uid = NULL ) : array
$uid integer 需要获取基本信息的用户UID,默认为当前登录用户。
return array

add_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/tags/create tags/create}
public add_tags ( mixed $tags ) : array
$tags mixed 要创建的一组标签,每个标签的长度不可超过7个汉字,14个半角字符。多个标签之间用逗号间隔,或由多个标签构成的数组。如:"abc,drf,efgh,tt"或array("abc", "drf", "efgh", "tt")
return array

add_to_favorites() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/create favorites/create}
public add_to_favorites ( integer $sid ) : array
$sid integer 收藏的微博id
return array

bilateral() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/bilateral friendships/friends/bilateral}
public bilateral ( integer $uid, integer $page = 1, integer $count = 50, integer $sort ) : array
$uid integer 需要获取双向关注列表的用户UID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$sort integer 排序类型,0:按关注时间最近排序,默认为0。
return array

bilateral_ids() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/bilateral/ids friendships/friends/bilateral/ids}
public bilateral_ids ( integer $uid, integer $page = 1, integer $count = 50, integer $sort ) : array
$uid integer 需要获取双向关注列表的用户UID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$sort integer 排序类型,0:按关注时间最近排序,默认为0。
return array

car_destroy() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/car_destroy account/profile/car_destroy}
public car_destroy ( integer $id ) : array
$id integer 职业信息里的公司ID
return array

car_update() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/car_update account/profile/car_update}
public car_update ( array $car_update ) : array
$car_update array 要修改的职业信息。格式:array('key1'=>'value1', 'key2'=>'value2', .....)。 支持设置的项: - id string 需要更新的职业信息ID。 - start int 进入公司年份,最小为1900,最大为当年年份。 - end int 离开公司年份,至今填0。 - department string 工作部门。 - visible int 可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - province int 省份代码ID,不可为空值。 - city int 城市代码ID,不可为空值。 - company string 公司名称,不可为空值。 参数province与city二者必选其一
参数id为空,则为新建职业信息,参数company变为必填项,参数id非空,则为更新,参数company可选
return array

comment_destroy() public method

注意:只能删除自己发布的评论,发布微博的用户不可以删除其他人的评论。
对应API:{@link http://open.weibo.com/wiki/2/statuses/comment_destroy statuses/comment_destroy}
public comment_destroy ( integer $cid ) : array
$cid integer 要删除的评论id
return array

comment_destroy_batch() public method

注意:只能删除自己发布的评论,发部微博的用户不可以删除其他人的评论。
对应API:{@link http://open.weibo.com/wiki/2/comments/destroy_batch comments/destroy_batch}
public comment_destroy_batch ( string $ids ) : array
$ids string 需要删除的评论ID,用半角逗号隔开,最多20个。
return array

comments_by_me() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/by_me comments/by_me}
public comments_by_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_source ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$since_id integer 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。
$filter_by_source integer 来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
return array

comments_daily() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/hot/comments_daily statuses/hot/comments_daily}
public comments_daily ( integer $count = 20, integer $base_app ) : array
$count integer 返回的记录条数,最大不超过50,默认为20。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

comments_mentions() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/mentions comments/mentions}
public comments_mentions ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$since_id integer 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。
$filter_by_author integer 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
$filter_by_source integer 来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
return array

comments_show_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/show_batch comments/show_batch}
public comments_show_batch ( string $cids ) : array
$cids string 需要查询的批量评论ID,用半角逗号分隔,最大50
return array

comments_timeline() public method

返回最新n条发送及收到的评论。
对应API:{@link http://open.weibo.com/wiki/2/comments/timeline comments/timeline}
public comments_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array
$page integer 页码
$count integer 每次返回的最大记录数,最多返回200条,默认50。
$since_id integer 若指定此参数,则只返回ID比since_id大的评论(比since_id发表时间晚)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的评论。可选。
return array

comments_to_me() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/to_me comments/to_me}
public comments_to_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$since_id integer 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。
$filter_by_author integer 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
$filter_by_source integer 来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
return array

comments_weekly() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/hot/comments_weekly statuses/hot/comments_weekly}
public comments_weekly ( integer $count = 20, integer $base_app ) : array
$count integer 返回的记录条数,最大不超过50,默认为20。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

delete() public method

根据ID删除微博消息。注意:只能删除自己发布的信息。
对应API:{@link http://open.weibo.com/wiki/2/statuses/destroy statuses/destroy}
public delete ( integer $id ) : array
$id integer 要删除的微博ID
return array

delete_dm() public method

按ID删除私信。操作用户必须为私信的接收人。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages/destroy direct_messages/destroy}
public delete_dm ( integer $did ) : array
$did integer 要删除的私信主键ID
return array

delete_dms() public method

批量删除当前登录用户的私信。出现异常时,返回400错误。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages/destroy_batch direct_messages/destroy_batch}
public delete_dms ( mixed $dids ) : array
$dids mixed 欲删除的一组私信ID,用半角逗号隔开,或者由一组评论ID组成的数组。最多20个。例如:"4976494627, 4976262053"或array(4976494627,4976262053);
return array

delete_tag() public method

对应API:{@link http://open.weibo.com/wiki/2/tags/destroy tags/destroy}
public delete_tag ( integer $tag_id ) : array
$tag_id integer 标签ID,必填参数
return array

delete_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/tags/destroy_batch tags/destroy_batch}
public delete_tags ( mixed $ids ) : array
$ids mixed 必选参数,要删除的tag id,多个id用半角逗号分割,最多10个。或由多个tag id构成的数组。如:“553,554,555"或array(553, 554, 555)
return array

destroy() public method

删除微博。注意:只能删除自己发布的信息。
对应API:{@link http://open.weibo.com/wiki/2/statuses/destroy statuses/destroy}
public destroy ( integer $id ) : array
$id integer 要删除的微博ID
return array

dm_conversation() public method

对应API:{@link http://open.weibo.com/wiki/2/direct_messages/conversation direct_messages/conversation}
public dm_conversation ( integer $uid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array
$uid integer 需要查询的用户的UID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$since_id integer 若指定此参数,则返回ID比since_id大的私信(即比since_id时间晚的私信),默认为0。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的私信,默认为0。
return array

dm_show_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/direct_messages/show_batch direct_messages/show_batch}
public dm_show_batch ( string $dmids ) : array
$dmids string 需要查询的私信ID,用半角逗号分隔,一次最多50个
return array

dm_user_list() public method

对应API:{@link http://open.weibo.com/wiki/2/direct_messages/user_list direct_messages/user_list}
public dm_user_list ( integer $count = 20, integer $cursor ) : array
$count integer 单页返回的记录条数,默认为20。
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
return array

domain_show() public method

对应API:{@link http://open.weibo.com/wiki/2/users/domain_show users/domain_show}
public domain_show ( mixed $domain ) : array
$domain mixed 用户个性域名。例如:lazypeople,而不是http://weibo.com/lazypeople
return array

edu_destroy() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/edu_destroy account/profile/edu_destroy}
public edu_destroy ( integer $id ) : array
$id integer 教育信息里的学校ID。
return array

edu_update() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/edu_update account/profile/edu_update}
public edu_update ( array $edu_update ) : array
$edu_update array 要修改的学校信息。格式:array('key1'=>'value1', 'key2'=>'value2', .....)。 支持设置的项: - type int 学校类型,1:大学、2:高中、3:中专技校、4:初中、5:小学,默认为1。必填参数 - school_id ` int 学校代码,必填参数 - id string 需要修改的教育信息ID,不传则为新建,传则为更新。 - year int 入学年份,最小为1900,最大不超过当前年份 - department string 院系或者班别。 - visible int 开放等级,0:仅自己可见、1:关注的人可见、2:所有人可见。
return array

emotions() public method

返回新浪微博官方所有表情、魔法表情的相关信息。包括短语、表情类型、表情分类,是否热门等。
对应API:{@link http://open.weibo.com/wiki/2/emotions emotions}
public emotions ( string $type = "face", string $language = "cnname" ) : array
$type string 表情类别。"face":普通表情,"ani":魔法表情,"cartoon":动漫表情。默认为"face"。可选。
$language string 语言类别,"cnname"简体,"twname"繁体。默认为"cnname"。可选
return array

favorites_by_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/by_tags favorites/by_tags}
public favorites_by_tags ( integer $tid, integer $page = 1, integer $count = 50 ) : array
$tid integer 需要查询的标签ID。'
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
return array

favorites_show() public method

根据收藏ID获取指定的收藏信息。
对应API:{@link http://open.weibo.com/wiki/2/favorites/show favorites/show}
public favorites_show ( integer $id ) : array
$id integer 需要查询的收藏ID。
return array

favorites_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/tags favorites/tags}
public favorites_tags ( integer $page = 1, integer $count = 50 ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
return array

favorites_tags_destroy_batch() public method

删除标签后,该用户所有收藏中,添加了该标签的收藏均解除与该标签的关联关系
对应API:{@link http://open.weibo.com/wiki/2/favorites/tags/destroy_batch favorites/tags/destroy_batch}
public favorites_tags_destroy_batch ( integer $tid ) : array
$tid integer 需要更新的标签ID。必填
return array

favorites_tags_update() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/tags/update favorites/tags/update}
public favorites_tags_update ( integer $id, string $tags ) : array
$id integer 需要更新的收藏ID。
$tags string 需要更新的标签内容,用半角逗号分隔,最多不超过2条。
return array

favorites_update_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/tags/update_batch favorites/tags/update_batch}
public favorites_update_batch ( integer $tid, string $tag ) : array
$tid integer 需要更新的标签ID。必填
$tag string 需要更新的标签内容。必填
return array

follow_by_id() public method

成功则返回关注人的资料,目前最多关注2000人,失败则返回一条字符串的说明。如果已经关注了此人,则返回http 403的状态。关注不存在的ID将返回400。
对应API:{@link http://open.weibo.com/wiki/2/friendships/create friendships/create}
public follow_by_id ( integer $uid ) : array
$uid integer 要关注的用户UID
return array

follow_by_name() public method

成功则返回关注人的资料,目前的最多关注2000人,失败则返回一条字符串的说明。如果已经关注了此人,则返回http 403的状态。关注不存在的ID将返回400。
对应API:{@link http://open.weibo.com/wiki/2/friendships/create friendships/create}
public follow_by_name ( string $screen_name ) : array
$screen_name string 要关注的用户昵称
return array

follow_create_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/create_batch friendships/create_batch}
public follow_create_batch ( string $uids ) : array
$uids string 要关注的用户UID,用半角逗号分隔,最多不超过20个。
return array

followers_active() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/followers/active friendships/followers/active}
public followers_active ( integer $uid, integer $count = 20 ) : array
$uid integer 需要查询的用户UID。
$count integer 返回的记录条数,默认为20,最大不超过200。
return array

followers_by_id() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/followers friendships/followers}
public followers_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array
$uid integer 需要查询的用户UID
$cursor integer false 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

followers_by_name() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/followers friendships/followers}
public followers_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array
$screen_name string 需要查询的用户的昵称
$cursor integer false 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

followers_ids_by_id() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/followers friendships/followers}
public followers_ids_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array
$uid integer 需要查询的用户UID
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

followers_ids_by_name() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/followers friendships/followers}
public followers_ids_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array
$screen_name string 需要查询的用户screen_name
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

friends_by_id() public method

如果没有提供cursor参数,将只返回最前面的5000个关注id
对应API:{@link http://open.weibo.com/wiki/2/friendships/friends friendships/friends}
public friends_by_id ( integer $uid, integer $cursor, integer $count = 50 ) : array
$uid integer 要获取的用户的ID。
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

friends_by_name() public method

如果没有提供cursor参数,将只返回最前面的5000个关注id
对应API:{@link http://open.weibo.com/wiki/2/friendships/friends friendships/friends}
public friends_by_name ( string $screen_name, integer $cursor, integer $count = 50 ) : array
$screen_name string 要获取的用户的 screen_name
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 单页返回的记录条数,默认为50,最大不超过200。
return array

friends_chain_followers() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends_chain/followers friendships/friends_chain/followers}
public friends_chain_followers ( integer $uid, integer $page = 1, integer $count = 50 ) : array
$uid integer 指定的关注目标用户UID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
return array

friends_ids_by_id() public method

如果没有提供cursor参数,将只返回最前面的5000个关注id
对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/ids friendships/friends/ids}
public friends_ids_by_id ( integer $uid, integer $cursor, integer $count = 500 ) : array
$uid integer 要获取的用户 UID,默认为当前用户
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 每次返回的最大记录数(即页面大小),不大于5000, 默认返回500。
return array

friends_ids_by_name() public method

如果没有提供cursor参数,将只返回最前面的5000个关注id
对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/ids friendships/friends/ids}
public friends_ids_by_name ( string $screen_name, integer $cursor, integer $count = 500 ) : array
$screen_name string 要获取的用户的 screen_name,默认为当前用户
$cursor integer 返回结果的游标,下一页用返回值里的next_cursor,上一页用previous_cursor,默认为0。
$count integer 每次返回的最大记录数(即页面大小),不大于5000, 默认返回500。
return array

friends_in_common() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/in_common friendships/friends/in_common}
public friends_in_common ( integer $uid, integer $suid = NULL, integer $page = 1, integer $count = 50 ) : array
$uid integer 需要获取共同关注关系的用户UID
$suid integer 需要获取共同关注关系的用户UID,默认为当前登录用户。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
return array

friends_remark_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/remark_batch friendships/friends/remark_batch}
public friends_remark_batch ( string $uids ) : array
$uids string 需要获取备注的用户UID,用半角逗号分隔,最多不超过50个。
return array

friends_timeline() public method

获取当前登录用户及其所关注用户的最新微博消息。和用户登录 http://weibo.com 后在“我的首页”中看到的内容相同。同home_timeline()
对应API:{@link http://open.weibo.com/wiki/2/statuses/friends_timeline statuses/friends_timeline}
public friends_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $base_app, integer $feature ) : array
$page integer 指定返回结果的页码。根据当前登录用户所关注的用户数及这些被关注用户发表的微博数,翻页功能最多能查看的总记录数会有所不同,通常最多能查看1000条左右。默认值1。可选。
$count integer 每次返回的记录数。缺省值50,最大值200。可选。
$since_id integer 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的微博消息。可选。
$base_app integer 是否基于当前应用来获取数据。1为限制本应用微博,0为不做限制。默认为0。可选。
$feature integer 微博类型,0全部,1原创,2图片,3视频,4音乐. 返回指定类型的微博信息内容。转为为0。可选。
return array

get_comments_by_sid() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/show comments/show}
public get_comments_by_sid ( integer $sid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author ) : array
$sid integer 需要查询的微博ID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$since_id integer 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。
$filter_by_author integer 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
return array

get_favorites() public method

返回用户的发布的最近20条收藏信息,和用户收藏页面返回内容是一致的。
对应API:{@link http://open.weibo.com/wiki/2/favorites favorites}
public get_favorites ( integer $page = 1, integer $count = 50 ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
return array

get_privacy() public method

对应API:{@link http://open.weibo.com/wiki/2/account/get_privacy account/get_privacy}
public get_privacy ( ) : array
return array

get_suggest_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/tags/suggestions tags/suggestions}
public get_suggest_tags ( integer $count = 10 ) : array
$count integer 单页大小。缺省值10,最大值10。可选。
return array

get_tags() public method

对应API:{@link http://open.weibo.com/wiki/2/tags tags}
public get_tags ( integer $uid = NULL, integer $page = 1, integer $count = 20 ) : array
$uid integer 查询用户的ID。默认为当前用户。可选。
$page integer 指定返回结果的页码。可选。
$count integer 单页大小。缺省值20,最大值200。可选。
return array

get_tags_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/tags/tags_batch tags/tags_batch}
public get_tags_batch ( string $uids ) : array
$uids string 要获取标签的用户ID。最大20,逗号分隔。必填
return array

get_uid() public method

对应API:{@link http://open.weibo.com/wiki/2/account/get_uid account/get_uid}
public get_uid ( ) : array
return array

home_timeline() public method

获取当前登录用户及其所关注用户的最新微博消息。和用户登录 http://weibo.com 后在“我的首页”中看到的内容相同。同friends_timeline()
对应API:{@link http://open.weibo.com/wiki/2/statuses/home_timeline statuses/home_timeline}
public home_timeline ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $base_app, integer $feature ) : array
$page integer 指定返回结果的页码。根据当前登录用户所关注的用户数及这些被关注用户发表的微博数,翻页功能最多能查看的总记录数会有所不同,通常最多能查看1000条左右。默认值1。可选。
$count integer 每次返回的记录数。缺省值50,最大值200。可选。
$since_id integer 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的微博消息。可选。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
$feature integer 过滤类型ID,0:全部、1:原创、2:图片、3:视频、4:音乐,默认为0。
return array

hot_favorites() public method

对应API:{@link http://open.weibo.com/wiki/2/suggestions/favorites/hot suggestions/favorites/hot}
public hot_favorites ( integer $page = 1, integer $count = 20 ) : array
$page integer 返回页码,默认1。选填
$count integer 每页返回结果数,默认20。选填
return array

hot_users() public method

返回系统推荐的用户列表。
对应API:{@link http://open.weibo.com/wiki/2/suggestions/users/hot suggestions/users/hot}
public hot_users ( string $category = "default" ) : array
$category string 分类,可选参数,返回某一类别的推荐用户,默认为 default。如果不在以下分类中,返回空列表:
- default:人气关注 - ent:影视名星 - hk_famous:港台名人 - model:模特 - cooking:美食&健康 - sport:体育名人 - finance:商界名人 - tech:IT互联网 - singer:歌手 - writer:作家 - moderator:主持人 - medium:媒体总编 - stockplayer:炒股高手
return array

id_format() protected method

protected id_format ( &$id )

is_followed_by_id() public method

如果源用户或目的用户不存在,将返回http的400错误
对应API:{@link http://open.weibo.com/wiki/2/friendships/show friendships/show}
public is_followed_by_id ( mixed $target_id, mixed $source_id = NULL ) : array
$target_id mixed 目标用户UID
$source_id mixed 源用户UID,可选,默认为当前的用户
return array

is_followed_by_name() public method

如果源用户或目的用户不存在,将返回http的400错误
对应API:{@link http://open.weibo.com/wiki/2/friendships/show friendships/show}
public is_followed_by_name ( mixed $target_name, mixed $source_name = NULL ) : array
$target_name mixed 目标用户的微博昵称
$source_name mixed 源用户的微博昵称,可选,默认为当前的用户
return array

list_dm() public method

返回用户的最新n条私信,并包含发送者和接受者的详细资料。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages direct_messages}
public list_dm ( integer $page = 1, integer $count = 50, int64 $since_id, int64 $max_id ) : array
$page integer 页码
$count integer 每次返回的最大记录数,最多返回200条,默认50。
$since_id int64 返回ID比数值since_id大(比since_id时间晚的)的私信。可选。
$max_id int64 返回ID不大于max_id(时间不晚于max_id)的私信。可选。
return array

list_dm_sent() public method

返回登录用户已发送最新50条私信。包括发送者和接受者的详细资料。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages/sent direct_messages/sent}
public list_dm_sent ( integer $page = 1, integer $count = 50, int64 $since_id, int64 $max_id ) : array
$page integer 页码
$count integer 每次返回的最大记录数,最多返回200条,默认50。
$since_id int64 返回ID比数值since_id大(比since_id时间晚的)的私信。可选。
$max_id int64 返回ID不大于max_id(时间不晚于max_id)的私信。可选。
return array

mentions() public method

返回最新n条提到登录用户的微博消息(即包含@username的微博消息)
对应API:{@link http://open.weibo.com/wiki/2/statuses/mentions statuses/mentions}
public mentions ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author, integer $filter_by_source, integer $filter_by_type ) : array
$page integer 返回结果的页序号。
$count integer 每次返回的最大记录数(即页面大小),不大于200,默认为50。
$since_id integer 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的提到当前登录用户微博消息。可选。
$filter_by_author integer 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
$filter_by_source integer 来源筛选类型,0:全部、1:来自微博、2:来自微群,默认为0。
$filter_by_type integer 原创筛选类型,0:全部微博、1:原创的微博,默认为0。
return array

public_timeline() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/public_timeline statuses/public_timeline}
public public_timeline ( integer $page = 1, integer $count = 50, integer $base_app ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

put_users_not_interested() public method

对应API:{@link http://open.weibo.com/wiki/2/suggestions/users/not_interested suggestions/users/not_interested}
public put_users_not_interested ( integer $uid ) : array
$uid integer 不感兴趣的用户的UID。
return array

queryid() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/queryid statuses/queryid}
public queryid ( integer | string $mid, integer $type = 1, integer $is_batch, integer $inbox, integer $isBase62 ) : array
$mid integer | string 需要查询的微博(评论、私信)MID,批量模式下,用半角逗号分隔,最多不超过20个。
$type integer 获取类型,1:微博、2:评论、3:私信,默认为1。
$is_batch integer 是否使用批量模式,0:否、1:是,默认为0。
$inbox integer 仅对私信有效,当MID类型为私信时用此参数,0:发件箱、1:收件箱,默认为0 。
$isBase62 integer MID是否是base62编码,0:否、1:是,默认为0。
return array

querymid() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/querymid statuses/querymid}
public querymid ( integer | string $id, integer $type = 1, integer $is_batch ) : array
$id integer | string 需要查询的微博(评论、私信)ID,批量模式下,用半角逗号分隔,最多不超过20个。
$type integer 获取类型,1:微博、2:评论、3:私信,默认为1。
$is_batch integer 是否使用批量模式,0:否、1:是,默认为0。
return array

rate_limit_status() public method

对应API:{@link http://open.weibo.com/wiki/2/account/rate_limit_status account/rate_limit_status}
public rate_limit_status ( ) : array
return array

remove_from_favorites() public method

对应API:{@link http://open.weibo.com/wiki/2/favorites/destroy favorites/destroy}
public remove_from_favorites ( integer $id ) : array
$id integer 要删除的收藏微博信息ID.
return array

remove_from_favorites_batch() public method

批量删除当前登录用户的收藏。出现异常时,返回HTTP400错误。
对应API:{@link http://open.weibo.com/wiki/2/favorites/destroy_batch favorites/destroy_batch}
public remove_from_favorites_batch ( mixed $fids ) : array
$fids mixed 欲删除的一组私信ID,用半角逗号隔开,或者由一组评论ID组成的数组。最多20个。例如:"231101027525486630,201100826122315375"或array(231101027525486630,201100826122315375);
return array

reply() public method

为防止重复,发布的信息与最后一条评论/回复信息一样话,将会被忽略。
对应API:{@link http://open.weibo.com/wiki/2/comments/reply comments/reply}
public reply ( integer $sid, string $text, integer $cid, integer $without_mention, integer $comment_ori ) : array
$sid integer 微博id
$text string 评论内容。
$cid integer 评论id
$without_mention integer 1:回复中不自动加入“回复@用户名”,0:回复中自动加入“回复@用户名”.默认为0.
$comment_ori integer 当评论转发微博时,是否评论给原微博,0:否、1:是,默认为0。
return array

repost() public method

可加评论。为防止重复,发布的信息与最新信息一样话,将会被忽略。
对应API:{@link http://open.weibo.com/wiki/2/statuses/repost statuses/repost}
public repost ( integer $sid, string $text = NULL, integer $is_comment ) : array
$sid integer 转发的微博ID
$text string 添加的评论信息。可选。
$is_comment integer 是否在转发的同时发表评论,0:否、1:评论给当前微博、2:评论给原微博、3:都评论,默认为0。
return array

repost_by_me() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/repost_by_me statuses/repost_by_me}
public repost_by_me ( integer $page = 1, integer $count = 50, integer $since_id, integer $max_id ) : array
$page integer 返回结果的页码。
$count integer 每次返回的最大记录数,最多返回200条,默认50。可选。
$since_id integer 若指定此参数,则只返回ID比since_id大的记录(比since_id发表时间晚)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的记录。可选。
return array

repost_daily() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/hot/repost_daily statuses/hot/repost_daily}
public repost_daily ( integer $count = 20, integer $base_app ) : array
$count integer 返回的记录条数,最大不超过50,默认为20。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

repost_timeline() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/repost_timeline statuses/repost_timeline}
public repost_timeline ( integer $sid, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $filter_by_author ) : array
$sid integer 要获取转发微博列表的原创微博ID。
$page integer 返回结果的页码。
$count integer 单页返回的最大记录数,最多返回200条,默认50。可选。
$since_id integer 若指定此参数,则只返回ID比since_id大的记录(比since_id发表时间晚)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的记录。可选。
$filter_by_author integer 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
return array

repost_weekly() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/hot/repost_weekly statuses/hot/repost_weekly}
public repost_weekly ( integer $count = 20, integer $base_app ) : array
$count integer 返回的记录条数,最大不超过50,默认为20。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

request_with_pager() protected method

protected request_with_pager ( $url, $page = false, $count = false, $params = [] )

request_with_uid() protected method

protected request_with_uid ( $url, $uid_or_name, $page = false, $count = false, $cursor = false, $post = false, $params = [] )

school_list() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/school_list account/profile/school_list}
public school_list ( array $query ) : array
$query array 搜索选项。格式:array('key0'=>'value0', 'key1'=>'value1', ....)。支持的key: - province int 省份范围,省份ID。 - city int 城市范围,城市ID。 - area int 区域范围,区ID。 - type int 学校类型,1:大学、2:高中、3:中专技校、4:初中、5:小学,默认为1。 - capital string 学校首字母,默认为A。 - keyword string 学校名称关键字。 - count int 返回的记录条数,默认为10。 参数keyword与capital二者必选其一,且只能选其一。按首字母capital查询时,必须提供province参数。
return array

search_at_users() public method

对应API:{@link http://open.weibo.com/wiki/2/search/suggestions/at_users search/suggestions/at_users}
public search_at_users ( string $q, integer $count = 10, integer $type, integer $range = 2 ) : array
$q string 搜索的关键字,必须做URLencoding。必填
$count integer 返回的记录条数,默认为10。
$type integer 联想类型,0:关注、1:粉丝。必填
$range integer 联想范围,0:只联想关注人、1:只联想关注人的备注、2:全部,默认为2。选填
return array

search_companies() public method

对应API:{@link http://open.weibo.com/wiki/2/search/suggestions/companies search/suggestions/companies}
public search_companies ( string $q, integer $count = 10 ) : array
$q string 搜索的关键字,必须做URLencoding。必填
$count integer 返回的记录条数,默认为10。
return array

search_schools() public method

对应API:{@link http://open.weibo.com/wiki/2/search/suggestions/schools search/suggestions/schools}
public search_schools ( string $q, integer $count = 10, $type = 1 ) : array
$q string 搜索的关键字,必须做URLencoding。必填
$count integer 返回的记录条数,默认为10。
return array

search_statuses() public method

对应API:{@link http://open.weibo.com/wiki/2/search/suggestions/statuses search/suggestions/statuses}
public search_statuses ( string $q, integer $count = 10 ) : array
$q string 搜索的关键字,必须做URLencoding。必填
$count integer 返回的记录条数,默认为10。
return array

search_statuses_high() public method

对应API:{@link http://open.weibo.com/wiki/2/search/statuses search/statuses}
public search_statuses_high ( array $query ) : array
$query array 搜索选项。格式:array('key0'=>'value0', 'key1'=>'value1', ....)。支持的key: - q string 搜索的关键字,必须进行URLencode。 - filter_ori int 过滤器,是否为原创,0:全部、1:原创、2:转发,默认为0。 - filter_pic int 过滤器。是否包含图片,0:全部、1:包含、2:不包含,默认为0。 - fuid int 搜索的微博作者的用户UID。 - province int 搜索的省份范围,省份ID。 - city int 搜索的城市范围,城市ID。 - starttime int 开始时间,Unix时间戳。 - endtime int 结束时间,Unix时间戳。 - count int 单页返回的记录条数,默认为10。 - page int 返回结果的页码,默认为1。 - needcount boolean 返回结果中是否包含返回记录数,true:返回、false:不返回,默认为false。 - base_app int 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。 needcount参数不同,会导致相应的返回值结构不同 以上参数全部选填
return array

search_users() public method

对应API:{@link http://open.weibo.com/wiki/2/search/suggestions/users search/suggestions/users}
public search_users ( string $q, integer $count = 10 ) : array
$q string 搜索的关键字,必须做URLencoding。必填,中间最好不要出现空格
$count integer 返回的记录条数,默认为10。
return array

search_users_keywords() public method

对应API:{@link http://open.weibo.com/wiki/2/search/users search/users}
public search_users_keywords ( array $query ) : array
$query array 搜索选项。格式:array('key0'=>'value0', 'key1'=>'value1', ....)。支持的key: - q string 搜索的关键字,必须进行URLencode。 - snick int 搜索范围是否包含昵称,0:不包含、1:包含。 - sdomain int 搜索范围是否包含个性域名,0:不包含、1:包含。 - sintro int 搜索范围是否包含简介,0:不包含、1:包含。 - stag int 搜索范围是否包含标签,0:不包含、1:包含。 - province int 搜索的省份范围,省份ID。 - city int 搜索的城市范围,城市ID。 - gender string 搜索的性别范围,m:男、f:女。 - comorsch string 搜索的公司学校名称。 - sort int 排序方式,1:按更新时间、2:按粉丝数,默认为1。 - count int 单页返回的记录条数,默认为10。 - page int 返回结果的页码,默认为1。 - base_app int 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。 以上所有参数全部选填
return array

send_comment() public method

对应API:{@link http://open.weibo.com/wiki/2/comments/create comments/create}
public send_comment ( integer $id, string $comment, integer $comment_ori ) : array
$id integer 需要评论的微博ID。
$comment string 评论内容,内容不超过140个汉字。
$comment_ori integer 当评论转发微博时,是否评论给原微博,0:否、1:是,默认为0。
return array

send_dm_by_id() public method

发送一条私信。成功将返回完整的发送消息。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages/new direct_messages/new}
public send_dm_by_id ( integer $uid, string $text, integer $id = NULL ) : array
$uid integer 用户UID
$text string 要发生的消息内容,文本大小必须小于300个汉字。
$id integer 需要发送的微博ID。
return array

send_dm_by_name() public method

发送一条私信。成功将返回完整的发送消息。
对应API:{@link http://open.weibo.com/wiki/2/direct_messages/new direct_messages/new}
public send_dm_by_name ( string $screen_name, string $text, integer $id = NULL ) : array
$screen_name string 用户昵称
$text string 要发生的消息内容,文本大小必须小于300个汉字。
$id integer 需要发送的微博ID。
return array

set_debug() public method

开启调试信息后,SDK会将每次请求微博API所发送的POST Data、Headers以及请求信息、返回内容输出出来。
public set_debug ( boolean $enable ) : void
$enable boolean 是否开启调试信息
return void

set_remote_ip() public method

SDK默认将会通过$_SERVER['REMOTE_ADDR']获取用户IP,在请求微博API时将用户IP附加到Request Header中。但某些情况下$_SERVER['REMOTE_ADDR']取到的IP并非用户IP,而是一个固定的IP(例如使用SAE的Cron或TaskQueue服务时),此时就有可能会造成该固定IP达到微博API调用频率限额,导致API调用失败。此时可使用本方法设置用户IP,以避免此问题。
public set_remote_ip ( string $ip ) : boolean
$ip string 用户IP
return boolean IP为非法IP字符串时,返回false,否则返回true

show_batch() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/show_batch statuses/show_batch}
public show_batch ( string $ids ) : array
$ids string 需要查询的微博ID,用半角逗号分隔,最多不超过50个。
return array

show_status() public method

获取单条ID的微博信息,作者信息将同时返回。
对应API:{@link http://open.weibo.com/wiki/2/statuses/show statuses/show}
public show_status ( integer $id ) : array
$id integer 要获取已发表的微博ID, 如ID不存在返回空
return array

show_user_by_id() public method

按用户UID或昵称返回用户资料,同时也将返回用户的最新发布的微博。
对应API:{@link http://open.weibo.com/wiki/2/users/show users/show}
public show_user_by_id ( integer $uid ) : array
$uid integer 用户UID。
return array

show_user_by_name() public method

按用户UID或昵称返回用户资料,同时也将返回用户的最新发布的微博。
对应API:{@link http://open.weibo.com/wiki/2/users/show users/show}
public show_user_by_name ( string $screen_name ) : array
$screen_name string 用户UID。
return array

suggestions_may_interested() public method

对应API:{@link http://open.weibo.com/wiki/2/suggestions/users/may_interested suggestions/users/may_interested}
public suggestions_may_interested ( integer $page = 1, integer $count = 10 ) : array
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为10。
return array

suggestions_users_by_status() public method

对应API:{@link http://open.weibo.com/wiki/2/suggestions/users/by_status suggestions/users/by_status}
public suggestions_users_by_status ( string $content, integer $num = 10 ) : array
$content string 微博正文内容。
$num integer 返回结果数目,默认为10。
return array

timeline_batch_by_id() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/timeline_batch statuses/timeline_batch}
public timeline_batch_by_id ( string $uids, integer $page = 1, integer $count = 50, integer $feature, integer $base_app ) : array
$uids string 需要查询的用户ID,用半角逗号分隔,一次最多20个。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$feature integer 过滤类型ID,0:全部、1:原创、2:图片、3:视频、4:音乐,默认为0。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

timeline_batch_by_name() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/timeline_batch statuses/timeline_batch}
public timeline_batch_by_name ( string $screen_name, integer $page = 1, integer $count = 50, integer $feature, integer $base_app ) : array
$screen_name string 需要查询的用户昵称,用半角逗号分隔,一次最多20个
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$feature integer 过滤类型ID,0:全部、1:原创、2:图片、3:视频、4:音乐,默认为0。
$base_app integer 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0。
return array

unfollow_by_id() public method

取消关注某用户。成功则返回被取消关注人的资料,失败则返回一条字符串的说明。
对应API:{@link http://open.weibo.com/wiki/2/friendships/destroy friendships/destroy}
public unfollow_by_id ( integer $uid ) : array
$uid integer 要取消关注的用户UID
return array

unfollow_by_name() public method

取消关注某用户。成功则返回被取消关注人的资料,失败则返回一条字符串的说明。
对应API:{@link http://open.weibo.com/wiki/2/friendships/destroy friendships/destroy}
public unfollow_by_name ( string $screen_name ) : array
$screen_name string 要取消关注的用户昵称
return array

update() public method

发布一条微博信息。
注意:lat和long参数需配合使用,用于标记发表微博消息时所在的地理位置,只有用户设置中geo_enabled=true时候地理位置信息才有效。
注意:为防止重复提交,当用户发布的微博消息与上次成功发布的微博消息内容一样时,将返回400错误,给出错误提示:“40025:Error: repeated weibo text!“。
对应API:{@link http://open.weibo.com/wiki/2/statuses/update statuses/update}
public update ( string $status, float $lat = NULL, float $long = NULL, mixed $annotations = NULL, integer $visible ) : array
$status string 要更新的微博信息。信息内容不超过140个汉字, 为空返回400错误。
$lat float 纬度,发表当前微博所在的地理位置,有效范围 -90.0到+90.0, +表示北纬。可选。
$long float 经度。有效范围-180.0到+180.0, +表示东经。可选。
$annotations mixed 可选参数。元数据,主要是为了方便第三方应用记录一些适合于自己使用的信息。每条微博可以包含一个或者多个元数据。请以json字串的形式提交,字串长度不超过512个字符,或者数组方式,要求json_encode后字串长度不超过512个字符。具体内容可以自定。例如:'[{"type2":123}, {"a":"b", "c":"d"}]'或array(array("type2"=>123), array("a"=>"b", "c"=>"d"))。
$visible integer 微博的可见性,0:所有人能看,1:仅自己可见,2:密友可见,3:指定分组可见,默认为0
return array

update_privacy() public method

对应API:{@link http://open.weibo.com/wiki/2/account/update_privacy account/update_privacy}
public update_privacy ( array $privacy_settings ) : array
$privacy_settings array 要修改的隐私设置。格式:array('key1'=>'value1', 'key2'=>'value2', .....)。 支持设置的项: - comment int 是否可以评论我的微博,0:所有人、1:关注的人,默认为0。 - geo int 是否开启地理信息,0:不开启、1:开启,默认为1。 - message int 是否可以给我发私信,0:所有人、1:关注的人,默认为0。 - realname int 是否可以通过真名搜索到我,0:不可以、1:可以,默认为0。 - badge int 勋章是否可见,0:不可见、1:可见,默认为1。 - mobile int 是否可以通过手机号码搜索到我,0:不可以、1:可以,默认为0。 以上参数全部选填
return array

update_profile() public method

对应API:{@link http://open.weibo.com/wiki/2/account/profile/basic_update account/profile/basic_update}
public update_profile ( array $profile ) : array
$profile array 要修改的资料。格式:array('key1'=>'value1', 'key2'=>'value2', .....)。 支持修改的项: - screen_name string 用户昵称,不可为空。 - gender i string 用户性别,m:男、f:女,不可为空。 - real_name string 用户真实姓名。 - real_name_visible int 真实姓名可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - province true int 省份代码ID,不可为空。 - city true int 城市代码ID,不可为空。 - birthday string 用户生日,格式:yyyy-mm-dd。 - birthday_visible int 生日可见范围,0:保密、1:只显示月日、2:只显示星座、3:所有人可见。 - qq string 用户QQ号码。 - qq_visible int 用户QQ可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - msn string 用户MSN。 - msn_visible int 用户MSN可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - url string 用户博客地址。 - url_visible int 用户博客地址可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - credentials_type int 证件类型,1:身份证、2:学生证、3:军官证、4:护照。 - credentials_num string 证件号码。 - email string 用户常用邮箱地址。 - email_visible int 用户常用邮箱地址可见范围,0:自己可见、1:关注人可见、2:所有人可见。 - lang string 语言版本,zh_cn:简体中文、zh_tw:繁体中文。 - description string 用户描述,最长不超过70个汉字。 填写birthday参数时,做如下约定: - 只填年份时,采用1986-00-00格式; - 只填月份时,采用0000-08-00格式; - 只填某日时,采用0000-00-28格式。
return array

update_profile_image() public method

对应API:{@link http://open.weibo.com/wiki/2/account/avatar/upload account/avatar/upload}
public update_profile_image ( string $image_path ) : array
$image_path string 要上传的头像路径, 支持url。[只支持png/jpg/gif三种格式, 增加格式请修改get_image_mime方法] 必须为小于700K的有效的GIF, JPG图片. 如果图片大于500像素将按比例缩放。
return array

update_remark() public method

只能修改当前登录用户所关注的用户的备注信息。否则将给出400错误。
对应API:{@link http://open.weibo.com/wiki/2/friendships/remark/update friendships/remark/update}
public update_remark ( integer $uid, string $remark ) : array
$uid integer 需要修改备注信息的用户ID。
$remark string 备注信息。
return array

upload() public method

发表图片微博消息。目前上传图片大小限制为<5M。
注意:lat和long参数需配合使用,用于标记发表微博消息时所在的地理位置,只有用户设置中geo_enabled=true时候地理位置信息才有效。
对应API:{@link http://open.weibo.com/wiki/2/statuses/upload statuses/upload}
public upload ( string $status, string $pic_path, float $lat = NULL, float $long = NULL, integer $visible ) : array
$status string 要更新的微博信息。信息内容不超过140个汉字, 为空返回400错误。
$pic_path string 要发布的图片路径, 支持url。[只支持png/jpg/gif三种格式, 增加格式请修改get_image_mime方法]
$lat float 纬度,发表当前微博所在的地理位置,有效范围 -90.0到+90.0, +表示北纬。可选。
$long float 可选参数,经度。有效范围-180.0到+180.0, +表示东经。可选。
$visible integer 微博的可见性,0:所有人能看,1:仅自己可见,2:密友可见,3:指定分组可见,默认为0
return array

upload_url_text() public method

对应API:{@link http://open.weibo.com/wiki/2/statuses/upload_url_text statuses/upload_url_text}
public upload_url_text ( string $status, string $url, integer $visible, string $list_id = NULL, string $pic_id = NULL, float $lat = NULL, float $long = NULL, string $annotations = NULL ) : array
$status string 要发布的微博文本内容,内容不超过140个汉字。
$url string 图片的URL地址,必须以http开头。
$visible integer 微博的可见性,0:所有人能看,1:仅自己可见,2:密友可见,3:指定分组可见,默认为0
$list_id string 微博的保护投递指定分组ID,只有当visible参数为3时生效且必选。
$pic_id string 已经上传的图片pid,多个时使用英文半角逗号符分隔,最多不超过9个。
$lat float 纬度,有效范围:-90.0到+90.0,+表示北纬,默认为0.0。
$long float 经度,有效范围:-180.0到+180.0,+表示东经,默认为0.0。
$annotations string 元数据,主要是为了方便第三方应用记录一些适合于自己使用的信息,每条微博可以包含一个或者多个元数据, 必须以json字串的形式提交,字串长度不超过512个字符,具体内容可以自定。
return array

user_timeline_by_id() public method

返回用户的发布的最近n条信息,和用户微博页面返回内容是一致的。此接口也可以请求其他用户的最新发表微博。
对应API:{@link http://open.weibo.com/wiki/2/statuses/user_timeline statuses/user_timeline}
public user_timeline_by_id ( mixed $uid = NULL, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $feature, integer $trim_user, integer $base_app ) : array
$uid mixed 指定用户UID或微博昵称
$page integer 页码
$count integer 每次返回的最大记录数,最多返回200条,默认50。
$since_id integer 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的提到当前登录用户微博消息。可选。
$feature integer 过滤类型ID,0:全部、1:原创、2:图片、3:视频、4:音乐,默认为0。
$trim_user integer 返回值中user信息开关,0:返回完整的user信息、1:user字段仅返回uid,默认为0。
$base_app integer 是否基于当前应用来获取数据。1为限制本应用微博,0为不做限制。默认为0。
return array

user_timeline_by_name() public method

返回用户的发布的最近n条信息,和用户微博页面返回内容是一致的。此接口也可以请求其他用户的最新发表微博。
对应API:{@link http://open.weibo.com/wiki/2/statuses/user_timeline statuses/user_timeline}
public user_timeline_by_name ( string $screen_name = NULL, integer $page = 1, integer $count = 50, integer $since_id, integer $max_id, integer $feature, integer $trim_user, integer $base_app ) : array
$screen_name string 微博昵称,主要是用来区分用户UID跟微博昵称,当二者一样而产生歧义的时候,建议使用该参数
$page integer 页码
$count integer 每次返回的最大记录数,最多返回200条,默认50。
$since_id integer 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。可选。
$max_id integer 若指定此参数,则返回ID小于或等于max_id的提到当前登录用户微博消息。可选。
$feature integer 过滤类型ID,0:全部、1:原创、2:图片、3:视频、4:音乐,默认为0。
$trim_user integer 返回值中user信息开关,0:返回完整的user信息、1:user字段仅返回uid,默认为0。
$base_app integer 是否基于当前应用来获取数据。1为限制本应用微博,0为不做限制。默认为0。
return array

users_show_batch_by_id() public method

对应API:{@link http://open.weibo.com/wiki/2/users/show_batch users/show_batch}
public users_show_batch_by_id ( string $uids ) : array
$uids string 需要查询的用户ID,用半角逗号分隔,一次最多20个。
return array

users_show_batch_by_name() public method

对应API:{@link http://open.weibo.com/wiki/2/users/show_batch users/show_batch}
public users_show_batch_by_name ( string $screen_name ) : array
$screen_name string 需要查询的用户昵称,用半角逗号分隔,一次最多20个。
return array

verify_nickname() public method

对应API:{@link http://open.weibo.com/wiki/2/register/verify_nickname register/verify_nickname}
public verify_nickname ( string $nickname ) : array
$nickname string 需要验证的昵称。4-20个字符,支持中英文、数字、"_"或减号。必填
return array