Skip to content

Commit

Permalink
created readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislavsa authored Sep 16, 2016
1 parent 1dd7939 commit 4041181
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# img-downloader
Download images to local folder

## Installation

```
$ composer require stanislavsa/img-downloader
```

## Basic Usage

```php
<?php
require __DIR__ . '/vendor/autoload.php';

use \Stanislavsa\ImgDownloader\Image as StImage;
use \Stanislavsa\ImgDownloader\Request as StRequest;

try {

$image_urls_list = array(
'http://images.freeimages.com/images/previews/8be/honda-s2000-mastercraft-wide-1483734.jpg',
'http://cdn.osxdaily.com/wp-content/uploads/2013/07/dancing-banana.gif',
'http://images.freeimages.com/images/previews/df3/car-engine-1629925.jpg',
'http://www.freepngimg.com/download/printer/7-printer-png-image.png',
'http://www.freepngimg.com/download/apple/42-apple-png-image.png',
);

$img = new StImage($image_urls_list);
// set path to store images
$img->setFolder( __DIR__ . '/images');
$req = new StRequest($img);
// download images
$req->send();

} catch(Exception $e) {
echo $e->getMessage();
}
```


0 comments on commit 4041181

Please sign in to comment.