Sha256: c9e81954f99ee84299d63f1466f4b0d2730eb0f93d9735891716a8a9fa8096ff

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Instagram < Basic

    attr_reader :author

    def initialize args, options
      super(args, options)
      @type = :instagram
      parsed = self.parse(args[0])
      @image_url = [self.get_basic(parsed)]
      @author = author(parsed)
      @file_name = [name()]
    end

    private

    def author page
      page.xpath("//meta[@property='instapp:owner_user_id']/@content")[0].value
    end

    def name
      unless @name.nil?
        "#{@type.to_s}-#{@name}"
      else
        "#{@type.to_s}-#{@workers.sanitize(@author)}-#{@workers.timed}.jpg"
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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