1

这是应该从谷歌域中获取用户的python脚本......由于某种原因,我似乎得到了授权标头错误。不知道我错过了什么尝试搜索但没有成功。

下面是整个python脚本。

import gdata.apps.service
import gdata.apps.groups.service
from array import *
import simplejson as json

consumer_key = '*******'
consumer_secret = 'd#######Q' #check advanced / OAuth in you control panel
sig_method = gdata.auth.OAuthSignatureMethod.HMAC_SHA1

service = gdata.apps.service.AppsService(domain=consumer_key)
service.SetOAuthInputParameters(sig_method, consumer_key, consumer_secret=consumer_secret, two_legged_oauth=True)
words=""
myDict = {}


res = service.RetrieveAllUsers()
for entry in res.entry:
    #words.append(entry.login.user_name)
    #myDict[entry.login.user_name] = entry.login.user_name
 words+=str(entry.login.user_name)+","


print words               

我在retrieveallusers() 处收到错误。

4

0 回答 0