class Ocawari::Strategy::Sirabee
Constants
- LARGEST_KNOWN_HEIGHT
- LARGEST_KNOWN_WIDTH
Private Instance Methods
has_gallery_images?()
click to toggle source
# File lib/ocawari/strategy/sirabee.rb, line 24 def has_gallery_images? page.css("div.entryGallery div.entryGallery-item img").any? end
parse()
click to toggle source
# File lib/ocawari/strategy/sirabee.rb, line 10 def parse if has_gallery_images? page.css("div.entryGallery div.entryGallery-item img").map do |img| img["src"].sub(/-\d{3}x\d{3}/, "-#{LARGEST_KNOWN_WIDTH}x#{LARGEST_KNOWN_HEIGHT}") end else page.css("article.entryContent section.entryContentBody img.size-large").map do |img| img["src"] end end end