/** * 同步微博评论 * * @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; }
function convertCharset($inCharset, $outCharset, $data) { if (is_array($data)) { $newData = array(); foreach ($data as $key => $value) { $newKey = PlatformApiClientUtility::convertCharset($inCharset, $outCharset, $key); $newValue = PlatformApiClientUtility::convertCharset($inCharset, $outCharset, $value); $newData[$newKey] = $newValue; } return $newData; } return pwConvert($data, $outCharset, $inCharset); }