Download the PHP package simondubois/unsplash-downloader without Composer
On this page you can find all versions of the php package simondubois/unsplash-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simondubois/unsplash-downloader
More information about simondubois/unsplash-downloader
Files in simondubois/unsplash-downloader
Package unsplash-downloader
Short Description CLI to download photos from unsplash.com
License GPL-2.0
Informations about the package unsplash-downloader
unsplash-downloader
CLI to download photos from unsplash.com
Status
This application is now considered as stable. No more features are planned, but feel free to suggest some if you need. Any help is welcome !
Usage
Download photos :
unsplash-downloader [--destination DESTINATION] [--quantity QUANTITY] [--history HISTORY] [--featured]
unsplash-downloader [--destination DESTINATION] [--quantity QUANTITY] [--history HISTORY] [--category CATEGORY]
unsplash-downloader [--categories]
Executable
The executable is located into the build directory.
Requirements
Dependency : PHP 5.5+ or 7 or hhvm.
Options
--destination DESTINATION
Directory where to download photos. Default: current working directory
--quantity QUANTITY
Number of photos to download. Default: 10
--history HISTORY
Filename to use as download history. When photos are downloaded, their IDs will be stored into the file. Then any further download is going to ignore photos that have their ID in the history. Usefull to delete unwanted pictures and prevent the CLI to download them again. Default: none
--featured
Download only featured photos (incompatible with the --category option). Default: false
--category CATEGORY
Only download photos for the given category ID (incompatible with the --featured option). Default: none
--categories
Print out categories and quit (no download). Default: false
Build from source
Get sources
git clone [email protected]:simondubois/unsplash-downloader.git
Install dependencies
cd unsplash-downloader/
composer install
Make your changes
CLI stub. Initial script to define application commands and run it.
An Application is the container for a collection of commands. It is the main entry point of a Console application. This class is optimized for a standard CLI environment.
A download command to handle the whole process to download photos. Steps are :
- check option validity (destination, count and history).
- create a task (to deal with Unsplash API).
- execute the task.
A task to download photos from Unsplash. Steps are
- list photos
- download photos
A proxy to deal with the Unsplah API :
- list photos
A proxy to handle history operations like :
- loading history from file
- checking existence of entity in history
- appending data to history
- saving history to file
Run tests
vendor/bin/phpunit
Test coverage can be found under tests/coverage
.
Build PHAR
php create-phar.php
The generated PHAR can be found under build
.