Skip to content

Commit

Permalink
readme and license added
Browse files Browse the repository at this point in the history
  • Loading branch information
hotrush committed Jan 5, 2016
1 parent 1007394 commit 8b625d9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Freek Van der Herten <[email protected]>

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.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 8b625d9

Please sign in to comment.