0
我需要从Google+个人资料访问职位,我可以使用特定ID进行操作。
但我想访问大约100个配置文件并阅读他们的职位名称,而无需任何用户标识。
我该怎么做?访问Google +用户个人资料ID
我需要从Google+个人资料访问职位,我可以使用特定ID进行操作。
但我想访问大约100个配置文件并阅读他们的职位名称,而无需任何用户标识。
我该怎么做?访问Google +用户个人资料ID
您可以使用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)
});
}
});
Thanks.Do你知道什么是:凭据凭据=新Credential.Builder(accessMethod) .setJsonFactory(jsonFactory) .setTransport(httpTransport) .setTokenServerEncodedUrl(tokenServerEncodedUrl) .setClientAuthentication(clientAuthentication) .setRequestInitializer(requestInitializer) .build(); –
看起来像Java的客户端库初始化。就个人而言,我更愿意将凭据构建为:GoogleCredential凭证= new GoogleCredential.Builder() .setJsonFactory(JSON_FACTORY).setTransport(TRANSPORT) .setClientSecrets(CLIENT_ID,CLIENT_SECRET).build(); – class