Sha256: 4ab65c6cd7c864fbaa1a209c1cd0e2b170ef3146ab17e628ef43c05d42ef6605

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Deviantart < Basic

    def initialize args, options = {}
      super(args, options)
      @type = :deviantart
      parsed = parse(args[0])
      @urls = album(parsed).compact
      @author = author()
      @path = "#{@path}/deviantart-#{@author}-#{@workers.timed}"
      @filenames = name_files()
    end

    private

    def author
      @workers.sanitize(@args[0].split('.com/')[1].chomp('/'))
    end

    def album page
      return [] if page.nil?
      refs = page.css('a.thumb')
      refs.map {|li| li['data-super-img']}
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nokaya-0.1.4 lib/nokaya/deviantart.rb
nokaya-0.1.3 lib/nokaya/deviantart.rb