承接 myweather/forecast 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

myweather/forecast

Composer 安装命令:

composer require myweather/forecast

包简介

A php wrapper for the Forecast.io API.

README 文档

README

MyWeather Forecast was created by, and is maintained by Tyler Youschak. MyWeather Forecast uses Forecast.io's weather API, so a free API key will be required. I've chosen Forecast.io due to the really inexpensive API, which supplies you with 1,000 free calls per day. If you go over 1,000 calls, it's only one-cent per 10,000 calls.

Requirements

Before installing Forecast, you need to make sure you have cURL installed on your server! Chances are this will already be completed!

Installation

To get the latest version of MyWeather Forecast, simply add the following line to the require block of your composer.json file:

"myweather/forecast": "~1.0@dev"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

If you're using Laravel 5, then you can register our service provider. Open up config/app.php and add the following to the providers array.

  • 'MyWeather\ForecastServiceProvider'

Usage

Usage of MyWeather Forecast is quite simple. To get started, you must first use our package. This will allow you to start using our package, here's an example: use MyWeather\ForecastClient;

Alright! We are now using the package, but how and where are we going to declare our API key (provided by Forecast.io)? Well, let's take a look:

  • You can use it by typing the following: $client = ForecastClient($apiKey); This will go ahead and set your API key for your request.
  • Now your going to want to set the latitude (lat) and longitude (lng) of the location your trying to find. It may be best to use Javascript and ask the person if you can use their location, or you can just hard code in a geo-location look up. Here's how you can do that: $forecast = $client->get('lat','lng');
  • Now, let's get the viddles! You can now (since you have declared your API key and lat & lng), use our currently, minutely, hourly, and daily selectors which will return that information in an array.

Here's a look at all of that combined:

use MyWeather\ForecastClient;

$client = new ForecastClient($apiKey);
$forecast = $client->get('lat','lng');
$currently = $forecast->currently();

Contribute

Have an idea of a new data selector that should be added? Or do you have an idea that will make this package even better? Open an issue report, and we'll have a gander!

myweather/forecast 适用场景与选型建议

myweather/forecast 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44 次下载、GitHub Stars 达 5, 最近一次更新时间为 2015 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「weather」 「forecast」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 myweather/forecast 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 myweather/forecast 我们能提供哪些服务?
定制开发 / 二次开发

基于 myweather/forecast 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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