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个字符,具体内容可以自定。 |
Résultat | array |
function upload_url_text($status, $url, $visible = 0, $list_id = NULL, $pic_id = NULL, $lat = NULL, $long = NULL, $annotations = NULL)
{
$params = array();
$params['status'] = $status;
$params['url'] = $url;
$params['visible'] = $visible;
if (!is_null($list_id)) {
$params['list_id'] = $list_id;
}
if (!is_null($pic_id)) {
$params['pic_id'] = $pic_id;
}
if (!is_null($lat)) {
$params['lat'] = $lat;
}
if (!is_null($long)) {
$params['long'] = $long;
}
if (!is_null($annotations)) {
$params['annotations'] = $annotations;
}
return $this->oauth->post('statuses/upload_url_text', $params, true);
}
@(include_once S_ROOT . './source/weibo/config.php'); @(include_once S_ROOT . './source/weibo/saetv2.ex.class.php'); $weibo = $message; $pic = $_POST['datapicpath'] ? 'http://i.buaa.edu.cn/' . $_SC['attachurl'] . $_POST['datapicpath'] : ''; $ToWEIBO = $_POST["sina"]; $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacefield') . " WHERE uid='{$uid}'"); if ($updo = $_SGLOBAL['db']->fetch_array($query)) { $token = $updo['sina_token']; } else { $token = $_POST['valsina']; } if ($ToWEIBO) { $setarr = array('sina_token' => $token); updatetable('spacefield', $setarr, array('uid' => $_SGLOBAL['supe_uid'])); $c = new SaeTClientV2(WB_AKEY, WB_SKEY, $token); $ret = $pic ? $c->upload_url_text($weibo, $pic) : $c->update($weibo); if (isset($ret['error_code']) && $ret['error_code'] > 0) { //showmessage($ret['error_code'].":".$ret['error']); echo "weibo_error"; exit; } } $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('feed') . " WHERE feedid='{$feedid}'"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['share_url'] = get_shareurl($value['idtype'], $value['id']); if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { realname_set($value['uid'], $value['username']); $value['num'] = get_commentnum($value['idtype'], $value['id']); } } $value = mkfeed($value);