class Datahen::CLI::ScraperExport

Public Class Methods

banner(command, namespace = nil, subcommand = false) click to toggle source

Public Instance Methods

download(export_id) click to toggle source
# File lib/datahen/cli/scraper_export.rb, line 33
def download(export_id)
  client = Client::ScraperExport.new(options)
  result = JSON.parse(client.download(export_id).to_s)

  if result['signed_url']
    puts "Download url: \"#{result['signed_url']}\""
    begin
      `open "#{result['signed_url']}"`
    rescue
    end
  else
    puts "Exported file does not exist"
  end
end
list() click to toggle source
# File lib/datahen/cli/scraper_export.rb, line 22
def list()
  if options[:scraper_name]
    client = Client::ScraperExport.new(options)
    puts "#{client.all(options[:scraper_name])}"
  else
    client = Client::Export.new(options)
    puts "#{client.all}"
  end
end
show(export_id) click to toggle source
# File lib/datahen/cli/scraper_export.rb, line 10
def show(export_id)
  client = Client::ScraperExport.new(options)
  puts "#{client.find(export_id)}"
end