Sha256: 27937b7d77d13c0036e39f79d6c02106a4f811d7881bd2d9c560e0839a91f58a

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 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.2 lib/nokaya/instagram.rb