Sha256: 08d663b290a0989d610fd3d298d56b5a8c8da328832a16ff3c0052ad13ba3d08

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Photonet < Basic

    def initialize args, options
      super(args, options)
      @type = :photonet
      parsed = self.parse(args[0])
      @image_url = album(parsed)
      @path = "#{@path}/photonet-#{@workers.timed}"
      @file_name = name()
    end

    private

    def album page
      refs = page.css('.trp-top a')
      refs.map do |lin|
        "http://gallery.photo.net/photo/#{lin['href'].split("=").last}-lg.jpg"
      end
    end

    def name
      @image_url.map do |url|
        "#{@type.to_s}-#{File.basename(url).gsub('-lg', '')}"
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nokaya-0.1.1 lib/nokaya/photonet.rb