From 8b625d965afbc42af34c7432e28f873ca9ba4aa6 Mon Sep 17 00:00:00 2001 From: rush Date: Tue, 5 Jan 2016 16:53:50 +0300 Subject: [PATCH] readme and license added --- .travis.yml | 2 -- LICENSE | 21 +++++++++++++++++++++ README.md | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 LICENSE diff --git a/.travis.yml b/.travis.yml index b2f1b2e..c7561d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,6 @@ matrix: before_install: - wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-3ubuntu0.4_amd64.deb - sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb -# - sudo apt-get update -# - sudo apt-get -y install libicu52 before_script: - composer self-update diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..55e4eda --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Freek Van der Herten + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1256635..f04089b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ -[![Build Status](https://travis-ci.org/hotrush/Webshotter.svg?branch=master)](https://travis-ci.org/hotrush/Webshotter) +[![Build Status](https://img.shields.io/travis/hotrush/webshotter/master.svg?style=flat-square)](https://travis-ci.org/hotrush/Webshotter) +[![Latest Version](https://img.shields.io/github/release/hotrush/webshotter.svg?style=flat-square)](https://github.com/hotrush/webshotter/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) +[![Total Downloads](https://img.shields.io/packagist/dt/hotrush/webshotter.svg?style=flat-square)](https://packagist.org/packages/hotrush/webshotter) +# Webshotter +Take website's screenshots with PHP/PhantomJS and save them to PNG, JPG or PDF + +## Installation + +``` +composer require hotrush/webshotter +``` + +## Usage + +``` +$webshot = new hotrush\Webshotter\Webshot(); +$jpg = $webshot + ->setUrl('https://github.com') + ->setWidth(1200) + ->setHeight(800) + ->setFullPage(true) // set to true to get full page screenshot (width/height will be used for viewport only) + ->saveToPng('github', $path); +``` + +You can use ```saveToJpg```, ```saveToPng``` or ```saveToPdf``` methods. This methods requires 2 parameters: file name (without extension) and target directory to save file. They all returns full path to saved file + +If you want to use you own PhantomJs executable - you can specify path to it via constructor. + +``` +new hotrush\Webshotter\Webshot('/path/to/phantomjs'); +``` + +## License + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information.