GithubHelp home page GithubHelp logo

auto_screenshot's Introduction

AutoScreenshot

Built to capture screenshots of a list of webpages in an automated fashion.

Installation

Add this line to your application's Gemfile:

gem 'auto_screenshot'

And then run:

bundle

Or install it yourself as:

gem install auto_screenshot

Options

URLs

An array of valid URLs. Pretty simple.

Folder

folder is where the screenshots will be saved. The default location is the screenshots folder based on where the program is run. But, the example below passes a specific folder path to save screenshots at.

client = AutoScreenshot::Screenshot.new(:folder => '/path/to/folder/')

Action Map

action_map is a ruby hash. each key of the hash is a full URL string and each key is a symbol. The symbol corresponds to a name of a method like wait. Here is an example:

action_map = {
  "http://example.com/page" => :wait
}

And a custom method could look like:

def wait
  sleep 10 # To allow you to login or something
end

Usage

AutoScreenshot saves screenshots of webpages as .png files in a folder. Create a Screenshot client and specify an array of URLs to capture.

Create a Client. Then set options.

client = AutoScreenshot::Screenshot.new #=> get a Screenshot object
client.urls = ["http://google.com, http://github.com"]
client.folder = "/custom/folder/path"
client.action_map = {
  "http://example.com/do-something-custom-at-this-url" => :custom_method
}

or

Create a Client with options.

client = AutoScreenshot::Screenshot.new(:urls => [], :folder => "/custom/folder/path", :action_map => {@url_string => :custom_method})

Contributing

  1. Say hi and let me know you're using aut
  2. Fork it
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

During Development

Run this from the auto_screenshot/ directory.

irb
load 'lib/auto_screenshot.rb'

And, to build the .gem:

gem build auto_screenshot.gemspec

auto_screenshot's People

Contributors

afomi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.