Giter VIP home page Giter VIP logo

webshotter-microservice's Introduction

Build Status Software License

Webshotter microservice

Simpe RESTful microservice with Lumen and hotrush/Webshotter package that creates pages screenshots and store it locally / s3 / rackspace (last one TBD)

Changelog

0.1.1 - added timeout param

Installation

git clone [email protected]:hotrush/Webshotter-microservice.git
cd Webshotter-microservice
cp .env.example .env
composer install

note - .env file has all required config options, take a look at ACCESS_KEY that used for api authentication. Also here you can configure destination storage - local, s3 or rackspace

Usage

Ping-pong

GET /api/ping

Webshot creating

POST /api/webshot?key=YOUR_ACCESS_KEY
{
    "url": "https://github.com", // required
    "extension": "jpg", // optional, can be jpg, png or pdf, jpg default 
    "width": 1200, // optional, integer, default 1200
    "height": 800, // optional, integer, default 800
    "full_page": 0, // optional, 1 or 0
    "filename": "test", // optional, result file name without extension, alpha_dash
    "path": "2016/01/01", // optional, path to save result file
    "timeout": 10 // in seconds
}

And this will return next:

{
    "path": "2016/01/01/test.jpg",
    "url": "http://YOUR_SITE/webshots/2016/01/01/test.jpg" // or for example for s3 https://s3-eu-west-1.amazonaws.com/your-bucket/2016/01/01/test.jpg
}

If timeout has been reached next will be return (with 500 status code):

{
    "message": "Link timeout."
}

Contributing

Feel free to post found bugs or make prs.

Testing

php ./vendor/bin/phpunit

License

The MIT License (MIT). Please see License File for more information.

webshotter-microservice's People

Contributors

hotrush avatar

Watchers

James Cloos avatar Kishore Chandra Sahoo 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.