21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/picasa/client/gallery.rb', line 21
def create_gallery(options = {})
title = options[:title].nil? ? "" : options[:title]
summary = options[:summary].nil? ? "" : options[:summary]
location = options[:location].nil? ? "" : options[:location]
access = options[:access].nil? ? "public" : options[:access]
= options[:commentable].nil? ? "true" : options[:commentable].to_s
keywords = options[:keywords].nil? ? "" : options[:keywords]
time_i = (Time.now).to_i
body = "<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
<title type='text'>#{title}</title>
<summary type='text'>#{summary}</summary>
<gphoto:location>#{location}</gphoto:location>
<gphoto:access>#{access}</gphoto:access>
<gphoto:commentingEnabled>#{}</gphoto:commentingEnabled>
<gphoto:timestamp>#{time_i}</gphoto:timestamp>
<media:group>
<media:keywords>#{keywords}</media:keywords>
</media:group>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/photos/2007#album'></category>
</entry>"
response = post("https://picasaweb.google.com/data/feed/api/user/default", body)
status, , body = response
case status
when 200
return body
else
return body
end
end
|