Sha256: 1220d126f65a8eb0f2101a19199dc80298faf9ceff3516b1a2bf179b35640d19
Contents?: true
Size: 835 Bytes
Versions: 17
Compression:
Stored size: 835 Bytes
Contents
# Download photos example # Matthew Epler, Sept 2012 require "picasa" require "open-uri" username = "user@gmail.com" dir = "/Users/path.../" begin client = Picasa::Client.new(:user_id => username) albums = client.album.list.entries albums.each do |album| Dir.chdir(dir) this_album = client.album.show(album.id).entries Dir.mkdir(album.title) Dir.chdir(album.title) for photo in this_album begin get_string = photo.content.src puts "processing" << photo.id rescue Exception => e puts photo.id << " **ERROR**" puts e end open(get_string) do |f| File.open(photo.title, "wb") do |file| file.puts f.read end end puts "======================================" end end rescue Picasa::ForbiddenError puts "You have the wrong user_id or password." end
Version data entries
17 entries across 17 versions & 1 rubygems