定制 simondubois/unsplash-downloader 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

simondubois/unsplash-downloader

Composer 安装命令:

composer require simondubois/unsplash-downloader

包简介

CLI to download photos from unsplash.com

README 文档

README

Unsplash image

CLI to download photos from unsplash.com

Status

Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight

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 git@github.com:simondubois/unsplash-downloader.git

Install dependencies

cd unsplash-downloader/
composer install

Make your changes

	cli/index.php

CLI stub. Initial script to define application commands and run it.

	src/Application.php

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.

	src/Download.php

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.
	src/Task.php

A task to download photos from Unsplash. Steps are

  • list photos
  • download photos
	src/Unsplash.php

A proxy to deal with the Unsplah API :

  • list photos
	src/History.php

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.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2016-02-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固