Sha256: e8351f69c8448516fc5d7da0200e714d2472eb73369c129114bad52a71142bd6

Contents?: true

Size: 540 Bytes

Versions: 19

Compression:

Stored size: 540 Bytes

Contents

require "picasa"

# delete all photos in an album.
begin
  client = Picasa::Client.new(:user_id => "your_gmail_account", :password => "password")
  albums = client.album.list.entries
  album = albums.find { |album| album.title == "New Album" }

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

  photos.each do |photo|
    if client.tag.delete(album_id, photo.id)
      "#{photo.title} deleted"
    else
      "#{photo.title} failed to delete"
    end
  end
rescue Picasa::ForbiddenError
  puts "You have the wrong user_id or password."
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
picasa-0.8.0 examples/delete_all_photos.rb
picasa-0.7.5 examples/delete_all_photos.rb
picasa-0.7.4 examples/delete_all_photos.rb
picasa-0.7.3 examples/delete_all_photos.rb
picasa-0.7.2 examples/delete_all_photos.rb
picasa-0.7.1 examples/delete_all_photos.rb
picasa-0.7.0 examples/delete_all_photos.rb
picasa-0.6.7 examples/delete_all_photos.rb
picasa-0.6.6 examples/delete_all_photos.rb
picasa-0.6.5 examples/delete_all_photos.rb
picasa-0.6.4 examples/delete_all_photos.rb
picasa-0.6.3 examples/delete_all_photos.rb
picasa-0.6.2 examples/delete_all_photos.rb
picasa-0.6.1 examples/delete_all_photos.rb
picasa-0.6.0 examples/delete_all_photos.rb
picasa-0.5.4 examples/delete_all_photos.rb
picasa-0.5.3 examples/delete_all_photos.rb
picasa-0.5.2 example/delete_all_photos.rb
picasa-0.5.1 example/delete_all_photos.rb