StatusService.php
3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
class StatusService extends RennServiceBase {
/**
* 获取用户状态
* <br />对应API:{$link http://dev.renren.com/API/v2/status/get }
* @param Long $statusId 状态ID
* @param Long $ownerId 状态所有者的用户ID
* @return Status 状态
*/
function getStatus($statusId, $ownerId) {
$params = array();
$bodyParams = array();
$fileParams = array();
if (isset($statusId)) {
$params ['statusId'] = $statusId;
}
if (isset($ownerId)) {
$params ['ownerId'] = $ownerId;
}
return $this->client->execute('/v2/status/get', 'GET', $params, $bodyParams, $fileParams);
}
/**
* 更新用户状态
* <br />对应API:{$link http://dev.renren.com/API/v2/status/put }
* @param String $content 状态的内容。状态内容不能长于240个字符。内容中的UBB表情代码未经过处理,需要开发者自行进行替换。UBB表情参见:[http://wiki.dev.renren.com/wiki/V2/ubb/list 获取人人网ubb列表]
* @return Status 状态
*/
function putStatus($content) {
$params = array();
$bodyParams = array();
$fileParams = array();
if (isset($content)) {
$params ['content'] = $content;
}
return $this->client->execute('/v2/status/put', 'POST', $params, $bodyParams, $fileParams);
}
/**
* 获取用户状态列表
* <br />对应API:{$link http://dev.renren.com/API/v2/status/list }
* @param Long $ownerId 状态所有者的用户ID
* @param Integer $pageSize 页面大小。取值范围1-100,默认大小20
* @param Integer $pageNumber 页码。取值大于零,默认值为1
* @return Status 状态
*/
function listStatus($ownerId, $pageSize, $pageNumber) {
$params = array();
$bodyParams = array();
$fileParams = array();
if (isset($ownerId)) {
$params ['ownerId'] = $ownerId;
}
if (isset($pageSize)) {
$params ['pageSize'] = $pageSize;
}
if (isset($pageNumber)) {
$params ['pageNumber'] = $pageNumber;
}
return $this->client->execute('/v2/status/list', 'GET', $params, $bodyParams, $fileParams);
}
/**
* 分享用户状态
* <br />对应API:{$link http://dev.renren.com/API/v2/status/share }
* @param String $content 状态的内容。状态内容不能长于240个字符。内容中的UBB表情代码未经过处理,需要开发者自行进行替换。UBB表情参见:[http://wiki.dev.renren.com/wiki/V2/ubb/list 获取人人网ubb列表]
* @param Long $statusId 状态ID
* @param Long $ownerId 状态所有者的用户ID
* @return Status 状态
*/
function shareStatus($content, $statusId, $ownerId) {
$params = array();
$bodyParams = array();
$fileParams = array();
if (isset($content)) {
$params ['content'] = $content;
}
if (isset($statusId)) {
$params ['statusId'] = $statusId;
}
if (isset($ownerId)) {
$params ['ownerId'] = $ownerId;
}
return $this->client->execute('/v2/status/share', 'POST', $params, $bodyParams, $fileParams);
}
}
?>