nwidart/forecast-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nwidart/forecast-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require nwidart/forecast-php

包简介

PHP client package for the Forecast.io service

README 文档

README

Latest Version Software License Build Status Coverage Status Quality Score SensioLabs Insight Total Downloads

A PHP client package for the Forecast.io API.

Want to use this inside a Laravel application? Check out the Laravel-Forecast package.

Install

Via Composer

$ composer require nwidart/forecast-php

Usage

$forecast = new \Nwidart\ForecastPhp\Forecast('your_api_key');

// Simple latitude and longitude
$info = $forecast->get('40.7324296', '-73.9977264');

// Fetch weather at a given time
$info = $forecastPhp->get('40.7324296', '-73.9977264', '2013-05-06T12:00:00-0400');

// Add options to the request
$info = $forecastPhp->setOptions(['units' => 'si',])->get('40.7324296', '-73.9977264');

For more details and all available options check the official documentation.

An example response:

{
  "latitude": 40.7324296,
  "longitude": -73.9977264,
  "timezone": "America/New_York",
  "offset": -4,
  "currently": {
    "time": 1438445386,
    "summary": "Partly Cloudy",
    "icon": "partly-cloudy-day",
    "nearestStormDistance": 63,
    "nearestStormBearing": 360,
    "precipIntensity": 0,
    "precipProbability": 0,
    "temperature": 84.71,
    "apparentTemperature": 85.39,
    "dewPoint": 62.25,
    "humidity": 0.47,
    "windSpeed": 7.95,
    "visibility": 10,
    "cloudCover": 0.59,
    "pressure": 1010.33,
    "ozone": 323.24
  },
  "minutely": {
    ...
  },
  "hourly": {
    ...
  },
  "daily": {
    ...
  },
  "flags": {
    ...
  },
  "headers": {
    ...
  }
}

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固