0
是否有可能建立網址到用戶的頁面,知道他的ID? 我試過類似https://plus.google.com/u/0/但它沒有工作。按用戶ID獲取谷歌加頁面url
是否有可能建立網址到用戶的頁面,知道他的ID? 我試過類似https://plus.google.com/u/0/但它沒有工作。按用戶ID獲取谷歌加頁面url
這只是https://plus.google.com/userId
。以+ Google爲例:https://plus.google.com/116899029375914044550。
$userid = "116899029375914044550";
$url = "https://www.googleapis.com/plus/v1/people/".$userid."/";
$params = array(
'key' => 'YOURKEY'
);
$param_string = array();
foreach($params as $key => $param){
$param_string[] = $key.'='.urlencode(trim($param));
}
$url = $url.'?'.implode('&',$param_string);
$ch = curl_init($url);
curl_setopt ($ch , CURLOPT_RETURNTRANSFER , true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response);
$url = $data->url;
echo $url;
請考慮加入一些解釋。只發布原始代碼(特別是在如此大的塊中)使得答案很差。 – BartoszKP