/** * 同步微博评论 * * @param int $commentId * @param array $message * @return bool */ function sendComment($commentId, $message) { if ($commentId <= 0 || !$message || !isset($message['content']) || '' == $message['content'] || !isset($message['uid'])) { return false; } if (!$this->isWeiboContentTypePermitSync($message['uid'], 'comment')) { return false; } $data = $this->_generateWeiboCommentObject($commentId, $message); $platformApiClient = $this->_getPlatformApiClient(); $isSuccess = PlatformApiClientUtility::decodeJson($platformApiClient->post('weibo.sync.sendcomment', $data)); return isset($isSuccess->result) && $isSuccess->result; }
function isFollow($bindType, $siteUserId, $siteUserFriendId = 0) { $platformApiClient = $this->_getPlatformApiClient(); $isSuccess = PlatformApiClientUtility::decodeJson($platformApiClient->post('weibo.friendship.isfollow', array('site_uid' => $siteUserId, 'bind_type' => $bindType, 'friend_uid' => $siteUserFriendId))); return isset($isSuccess->result) && $isSuccess->result; }
function bindExistLoginUser($userId, $platformSessionId) { if ($userId <= 0) { return 0; } $platformApiClient = $this->_getPlatformApiClient(); $isSuccess = PlatformApiClientUtility::decodeJson($platformApiClient->post('weibo.login.bind', array('platformSessionId' => $platformSessionId, 'userId' => $userId))); return isset($isSuccess->result) ? $isSuccess->result : 0; }
/** * 将JSON数据转成本地php数据 * @param string $jsonString * @return Ambigous */ function jsonToLocalPhpValue($jsonString) { $utf8PhpValue = PlatformApiClientUtility::decodeJson($jsonString); if (is_null($utf8PhpValue)) { return null; } //转字符编码 $localCharset = $this->getLocalCharset(); $platformCharset = $this->getPlatformCharset(); if ($localCharset != $platformCharset) { return PlatformApiClientUtility::convertCharset($platformCharset, $localCharset, $utf8PhpValue); } return $utf8PhpValue; }