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
コード例 #1
0
ファイル: cp_doing.php プロジェクト: shiyake/php-ihome
 @(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);