定制 lsv/darksky-php-wrapper 二次开发

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

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

lsv/darksky-php-wrapper

Composer 安装命令:

composer require lsv/darksky-php-wrapper

包简介

Wrapper for darksky.net api

README 文档

README

Build Status codecov

PHP Wrapper for darksky.net weather api.

Supporting

  • Forecast
  • TimeMachine

Install

composer require lsv/darksky-php-wrapper

Usage

Forecast
$client = new Symfony\Component\HttpClient\HttpClient();
$apikey = 'your-api-key';
$latitude = 42.3601;
$longitude = -71.0589;

$forecast = new \Lsv\Darksky\Forecast($apikey, $client);
// Set the optional parameters
// See https://darksky.net/dev/docs#forecast-request for possible parameters
$forecast->exclude(['currently']); // Array of blocks to exclude from the call
$forecast->extendHourly(); // Extend hourly forecast to 148 hours
$forecast->language('da'); // Set the language
$forecast->units('si'); // Change the units

$response = $forecast->call($latitude, $longitude);
// $response is now a \Lsv\Darksky\Response\ForecastResponse object
Timemachine
$client = new Symfony\Component\HttpClient\HttpClient();
$apikey = 'your-api-key';
$latitude = 42.3601;
$longitude = -71.0589;
$time = new \DateTime();

$timemachine = new \Lsv\Darksky\Timemachine($apikey, $client);
// Set the optional parameters
// See https://darksky.net/dev/docs#forecast-request for possible parameters
$timemachine->exclude(['currently']); // Array of blocks to exclude from the call
$timemachine->language('da'); // Set the language
$timemachine->units('si'); // Change the units

$response = $timemachine->call($latitude, $longitude, $time);
// $response is now a \Lsv\Darksky\Response\TimemachineResponse object

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固