来自picasaweb on Rails的图片

时间:2015-08-27 18:46:16

标签: ruby-on-rails ruby image picasa

我需要在Rails上添加来自picasaweb的图像(添加,删除,查看)。我尝试了一些宝石(picasa等)。但是gem和json只返回专辑,images数组是空的。

1 个答案:

答案 0 :(得分:2)

使用此gem作为示例:

require "picasa"

# get some photos in an album
client = Picasa::Client.new(user_id: "your-gmail-account@gmail.com", access_token: "oauth-access-token")

albums = client.album.list.entries
album = albums.find { |album| album.title == "New Album" }

photos = client.album.show(album.id).entries

photos.each { |photo| puts photo.title }
  

https://github.com/morgoth/picasa

     

https://github.com/morgoth/picasa/blob/master/examples/get_some_photos.rb