Sha256: 68f1ae3f445bb69e7185bc26c9fc11f6c776c80c9b42d3799395958b6a986610
Contents?: true
Size: 819 Bytes
Versions: 17
Compression:
Stored size: 819 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 album = albums.find { |album| album.title == "your_album_name" } photos = client.album.show(album.id).entries photos.each do |photo| begin get_string = photo.content.src puts "processing " << photo.id rescue Exception => e puts photo.id << " **ERROR**" puts e Dir.chdir(dir) 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