Sha256: ffd57a46b4f46beecc0944053aaca3a8d3ceeefe55ee216e6002f2d5a4d8e73f

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Instagram < Basic

    attr_reader :author

    def initialize args, options = {}
      super(args, options)
      @type = :instagram
      parsed = parse(args[0])
      @urls = [get_basic(parsed)].compact
      @author = author(parsed)
      @filenames = name_files()
    end

    private

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

    def name_files
      unless @urls.empty?
        @name ||= @workers.sanitize(@author)
        ["#{@type.to_s}-#{@workers.sanitize(@author)}-#{@workers.timed}.jpg"]
      else
        []
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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