Sha256: 409422a2e34b07f39faeabef66e29c9a874fc04d89965f1078e626a46f8a10a8

Contents?: true

Size: 527 Bytes

Versions: 19

Compression:

Stored size: 527 Bytes

Contents

require "picasa"

# upload photo
begin
  client = Picasa::Client.new(:user_id => "your_gmail_account", :password => "password")

  photo_bin = File.binread("./test.jpg")

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

  client.photo.create(album.id,
    {
      :binary => photo_bin,
      :content_type => "image/jpeg",
      :title => "Test Photo",
      :summary => "Hoge hoge"
    }
  )

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/upload_photo.rb
picasa-0.7.5 examples/upload_photo.rb
picasa-0.7.4 examples/upload_photo.rb
picasa-0.7.3 examples/upload_photo.rb
picasa-0.7.2 examples/upload_photo.rb
picasa-0.7.1 examples/upload_photo.rb
picasa-0.7.0 examples/upload_photo.rb
picasa-0.6.7 examples/upload_photo.rb
picasa-0.6.6 examples/upload_photo.rb
picasa-0.6.5 examples/upload_photo.rb
picasa-0.6.4 examples/upload_photo.rb
picasa-0.6.3 examples/upload_photo.rb
picasa-0.6.2 examples/upload_photo.rb
picasa-0.6.1 examples/upload_photo.rb
picasa-0.6.0 examples/upload_photo.rb
picasa-0.5.4 examples/upload_photo.rb
picasa-0.5.3 examples/upload_photo.rb
picasa-0.5.2 example/upload_photo.rb
picasa-0.5.1 example/upload_photo.rb