做到這一點的方法是使用谷歌的API +這裏:https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get?userId=me&_h=2&
這是拉圖像已經過驗證的用戶的要求。
GET https://www.googleapis.com/plus/v1/people/me?key={YOUR_API_KEY}
你會得到一個像這樣的json響應,這很容易解析,並拉出image-> url值來顯示。
{
"kind": "plus#person",
"etag": "\"XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx\"",
"gender": "male",
"emails": [
{
"value": "[email protected]",
"type": "account"
}
],
"objectType": "person",
"id": "XxXxXxXxXxXxXxXxXxXxXxXx",
"displayName": "John Brahy",
"name": {
"familyName": "Brahy",
"givenName": "John"
},
"url": "https://plus.google.com/XxXxXxXxXxXxXxXxXxXxXxXx",
"image": {
"url": "https://lh3.googleusercontent.com/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/photo.jpg?sz=50"
},
"isPlusUser": true,
"language": "en",
"circledByCount": 2,
"verified": false,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "https://lh5.googleusercontent.com/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/Green%2BGrass.jpg",
"height": 240,
"width": 420
},
"coverInfo": {
"topImageOffset": 0,
"leftImageOffset": 0
}
},
"domain": "XxXxXxXx-x.com"
}
如何使用他們的電子郵件地址獲得GAvatar? –
我現在不用關於django中谷歌應用程序引擎的GAvatar。 –
@jayu http://stackoverflow.com/questions/4509660/stackoverflow-userpic-generation-identicons/4509708#4509708 –