CLI to download photos from unsplash.com
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 !
Download photos :
unsplash-downloader [--destination DESTINATION] [--quantity QUANTITY] [--history HISTORY] [--featured] unsplash-downloader [--destination DESTINATION] [--quantity QUANTITY] [--history HISTORY] [--category CATEGORY] unsplash-downloader [--categories]
The executable is located into the build directory.
Dependency : PHP 5.5+ or 7 or hhvm.
Directory where to download photos. Default: current working directory
Number of photos to download. Default: 10
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
Download only featured photos (incompatible with the --category option). Default: false
Only download photos for the given category ID (incompatible with the --featured option). Default: none
Print out categories and quit (no download). Default: false
Build from source
git clone firstname.lastname@example.org:simondubois/unsplash-downloader.git
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
Test coverage can be found under
The generated PHAR can be found under