Giter Site home page Giter Site logo

benpickles / screamshot Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 1.0 205 KB

A synchronous HTTP screenshot service for headless Chrome.

Home Page: https://benpickles.github.io/screamshot

License: MIT License

Ruby 80.68% Procfile 0.18% Dockerfile 19.13%
headless-chrome screenshot

screamshot's Introduction

Screamshot

CI

Screamshot logo

A synchronous HTTP screenshot service built on Sinatra and headless Chrome (via Ferrum).

Deploy to Heroku

Usage

Trigger a screenshot by making a GET request to /screenshot with a url querystring parameter. The endpoint is protected by basic HTTP authentication with your AUTH_TOKEN.

$ curl "http://[email protected]/screenshot?url=http://example.com" > screenshot.png

Options

Pass options via querystring parameters. A more complicated Screamshot URL might be the following combination of available options:

http://[email protected]/screenshot?url=http://example.com&viewport=800,600&full=true&scale=2&prefers-reduced-motion=reduce

URL

The URL to capture. The only required parameter.

url=http://example.com

Window / viewport size

Control the size of the viewport with WIDTH,HEIGHT. Defaults to 1024,768.

viewport=800,600

Full-screen

Capture the entire page instead of just the viewport. Defaults to false.

full=true

Scale (devicePixelRatio)

This mimics devicePixelRatio and scales the viewport so scale=2 combined with viewport=800,600 results in a 1600×1200 image. Defaults to 1.

scale=2

prefers-reduced-motion

Force the browser into prefers-reduced-motion=reduce mode. This can be used as a standards-based hint to the page not to use animations. Defaults to nothing and so is not enabled.

prefers-reduced-motion=reduce

Deployment

Deploying to Fly.io

Clone this repository and use flyctl to create and configure the app (say yes when asked whether you'd like to copy its configuration):

$ fly launch --name my-app-name

Deploying to Heroku

Deploy to Heroku

Development

Start the server with bundle exec puma -C config/puma.rb.

Run the tests with bundle exec rspec.

Write usage docs here, update the homepage with bin/update_docs.

Licence

Copyright © Ben Pickles, MIT licence.

screamshot's People

Contributors

benpickles avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

sergii

screamshot's Issues

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.