2013-08-21 43 views
2

有沒有什麼辦法從Google Plus專輯中獲取圖片,例如:以JSON格式。關於這些主題:從Google Plus專輯中獲取圖片 - 身份驗證

的方法是使用Picasa的URL。這完美,但只適用於公共相冊

在URL中使用authkey不起作用。 http://picasaweb.google.com/data/feed/api/user/ ...用戶ID ... /相冊/ ...相冊ID ...?authkey = ...授權密鑰... & alt = json

有沒有人有解決方案讓Google Plus專輯圖片在哪裏沒有公開相冊被詢問(使用authkey)。

謝謝。

回答

0

您可以使用Picasa網絡相冊的GData API:

  • 列表中的所有用戶的專輯
  • 識別專輯的ID,你關心
  • 獲取數據使用該專輯ALT = JSON
2

您可以使用Google plus授權,然後使用其令牌從Picasa請求相冊。 爲了得到你應該使用gapi.auth.authorize方法與相應的範圍,這是https://picasaweb.google.com/data/

var googleClientToken = '' 
var options = { 
    client_id: googleClientId, 
    scope: 'https://picasaweb.google.com/data/ https://www.googleapis.com/auth/userinfo.email' 
} 
gapi.auth.authorize(options, function() { 
    googleAccessToken = gapi.auth.getToken().access_token 
}) 

然後,只需獲取網址https://picasaweb.google.com/data/feed/api/user/USER_EMAIL/?kind=album&access_token=ACCESS_TOKEN&alt=json&access=all'

正確的權限