class Nokaya::Instagram

Attributes

author[R]

Public Class Methods

new(args, options = {}) click to toggle source
Calls superclass method Nokaya::Basic::new
# File lib/nokaya/instagram.rb, line 8
def initialize args, options = {}
  super(args, options)
  @type = :instagram
  parsed = parse(args[0])
  @urls = [get_basic(parsed)].compact
  @author = author_name(parsed)
  @filenames = name_files()
end

Private Instance Methods

author_name(page) click to toggle source
# File lib/nokaya/instagram.rb, line 19
def author_name page
  return [] if page.nil?
  page.xpath("//meta[@property='instapp:owner_user_id']/@content")[0].value
end
name_files() click to toggle source
# File lib/nokaya/instagram.rb, line 24
def name_files
  unless @urls.empty?
    @name ||= @workers.sanitize(@author)
    ["#{@type.to_s}-#{@workers.sanitize(@author)}-#{@workers.timed}.jpg"]
  else
    []
  end
end