2013-07-13 42 views
0

我需要從Google+個人資料訪問職位,我可以使用特定ID進行操作。
但我想訪問大約100個配置文件並閱讀他們的職位名稱,而無需任何用戶標識。
我該怎麼做?訪問Google +用戶個人資料ID

回答

1

您可以使用plus.people.search API搜索人員以獲取其ID並獲得他們的個人資料。

在JavaScript:

gapi.client.plus.people.search(
    { query: 'Gus', 
    fields: 'items/id' 
    }).execute(
     function(resp){ 
     for (var i=0; i < resp.items.length; i++){ 
      gapi.client.plus.people.get(
      { userId: resp.items[i].id, 
       fields: 'displayName,organizations(title)'}).execute(
       function(resp){ 
        console.log(resp) 
       }); 
     } 
     }); 
+0

Thanks.Do你知道什麼是:憑據憑據=新Credential.Builder(accessMethod) .setJsonFactory(jsonFactory) .setTransport(httpTransport) .setTokenServerEncodedUrl(tokenServerEncodedUrl) .setClientAuthentication(clientAuthentication) .setRequestInitializer(requestInitializer) .build(); –

+0

看起來像Java的客戶端庫初始化。就個人而言,我更願意將憑據構建​​爲:GoogleCredential憑證= new GoogleCredential.Builder() .setJsonFactory(JSON_FACTORY).setTransport(TRANSPORT) .setClientSecrets(CLIENT_ID,CLIENT_SECRET).build(); – class

相關問題