public function update($text, $opt)
{
require_once 'renren/HttpRequestService.class.php';
require_once 'renren/RenrenRestApiService.class.php';
$refresh_uri = 'https://graph.renren.com/oauth/token?grant_type=refresh_token&refresh_token=' . $opt["oauth_token_secret"] . '&client_id=' . RENREN_KEY . '&client_secret=' . RENREN_SECRET;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $refresh_uri);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$res = json_decode($result);
$access_token = $res->access_token;
$refresh_token = $res->refresh_token;
$config = new stdClass();
$config->APIURL = 'http://api.renren.com/restserver.do';
$config->APIKey = RENREN_KEY;
$config->SecretKey = RENREN_SECRET;
$config->APIVersion = '1.0';
$config->decodeFormat = 'json';
$GLOBALS['config'] =& $config;
$rrObj = new RenrenRestApiService();
$params = array('name' => getShort($opt["feed_content"], 30), 'description' => $opt["feed_content"], 'url' => $opt["feed_url"], 'image' => $opt["pic_url"], 'action_name' => $GLOBALS['ts']['site']['site_name'], 'action_link' => $opt["feed_url"], 'message' => '分享', 'access_token' => $access_token);
$res = $rrObj->rr_post_curl('feed.publishFeed', $params);
return true;
}