Class: Aviary::ImageHost::Plixi

Inherits:
Aviary::ImageHost show all
Defined in:
lib/aviary/image_host/plixi.rb

Instance Method Summary collapse

Methods inherited from Aviary::ImageHost

available, available?, match, match_and_create, matches

Instance Method Details

#hrefObject



7
8
9
# File 'lib/aviary/image_host/plixi.rb', line 7

def href
  "http://plixi.com/p/#{self.token}"
end

#set_metaObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/aviary/image_host/plixi.rb', line 15

def set_meta
  uri = URI.parse("http://api.plixi.com/api/tpapi.svc/photos/#{self.token}")
  doc = Nokogiri::XML(open(uri))
  self.meta = {
    :big_image_url       => doc.css('BigImageUrl').text,
    :large_image_url     => doc.css('LargeImageUrl').text,
    :medium_image_url    => doc.css('MediumImageUrl').text,
    :small_image_url     => doc.css('SmallImageUrl').text,
    :thumbnail_image_url => doc.css('ThumbnailUrl').text
  }
end

#srcObject



11
12
13
# File 'lib/aviary/image_host/plixi.rb', line 11

def src
  self.meta[:medium_image_url]
end