Module: Picasa::Client::Comments

Includes:
Base
Included in:
Picasa::Client
Defined in:
lib/picasa/client/comments.rb

Constant Summary

Constants included from Base

Base::DEFAULT_LANGUAGE

Instance Method Summary collapse

Methods included from Base

#format_response

Instance Method Details

#add_photo_comment(album_id, photo_id, comment) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/picasa/client/comments.rb', line 20

def add_photo_comment album_id, photo_id, comment
  body = "\r\n"
  body += "<entry xmlns='http://www.w3.org/2005/Atom'>"
  body += "<content>#{comment}</content>"
  body += "<category scheme=\"http://schemas.google.com/g/2005#kind\" term=\"http://schemas.google.com/photos/2007#comment\"/>"
  body += "</entry>\r\n"

  response = post("https://picasaweb.google.com/data/feed/api/user/default/albumid/#{album_id}/photoid/#{photo_id}", body)
  status, headers, body = response
  case status
    when 200
      return body
    else
      return body
    #raise(StandardError, "#{status.to_s} - #{body.to_s}")
  end
end

#list_photo_comments(album_id, photo_id) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/picasa/client/comments.rb', line 9

def list_photo_comments album_id, photo_id
  response = get("https://picasaweb.google.com/data/feed/api/user/default/albumid/#{album_id}/photoid/#{photo_id}?kind=comment")
  status, headers, body = response
  case status
    when 200
      return body
    else
      return body
  end
end