Sha256: 1ba16735123ecd57ee1a86f72bc97f68cbd63f2c6d2c9942d5ce3e6aa51b6ecd
Contents?: true
Size: 868 Bytes
Versions: 1
Compression:
Stored size: 868 Bytes
Contents
require 'screencap' # require 'smartshot' module YAMG # # Screenshot from multiple providers # class Screenshot attr_accessor :url, :size, :command # Uses PhantomJS def initialize(ss) require 'smartshot' require 'capybara' require 'capybara/poltergeist' @name, opts = *ss uri = URI.parse(opts['url']) @url = "http://#{uri}" @size = opts['size'].split(/\s?,\s?/) # @fetcher = Smartshot::Screenshot.new(window_size: @size) @fetcher = Screencap::Fetcher.new(@url) end def work(path) # visit(url) # page.save_screenshot("#{path}/#{@name}.png") # @fetcher.take_screenshot!(url: url, output: "#{path}/#{@name}.png") @fetcher.fetch(output: "#{path}/#{@name}.png", width: @size[0], height: @size[1]) puts Rainbow("SS #{url} #{size}").black end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
yamg-0.0.8 | lib/yamg/screenshot.rb |