hashbang/wunderground
Composer 安装命令:
composer require hashbang/wunderground
包简介
An simple Weather Underground PHP API
关键字:
README 文档
README
An exceptionally simple Weather Underground PHP class for simple data retrieval.
Installation
Download this GIT repository and copy into your application directory.
Alternatively, install with Composer.
Examples
The following will retrieve a detailed 2 day forecast in the form of an array. The last perameter specifies the gaps between data. In the below example its set to a day (60 seconds * 60 minutes * 24 hours). Omit this if you want as much data as possible.
<?php
require('wunderground.php');
$w = new Wunderground();
$w->get_forecast_data();
print_r($w->get_forecast_steps(time(), strtotime('+2 days'), 60*60*24));
?>
Will return
Array
(
[1305385200] => Array
(
[date] => Array
(
[epoc] => 1305385200
[iso] => 2011-05-15T01:00:00Z
)
[precipitation] => Array
(
[unit] => mm
[value] => 0.4
[minvalue] => 0.0
[maxvalue] => 0.8
)
[symbol] => Array
(
[id] => LIGHTRAINSUN
[number] => 5
)
)
[1305471600] => Array
(
[date] => Array
(
[epoc] => 1305471600
[iso] => 2011-05-16T01:00:00Z
)
[temperature] => Array
(
[id] => TTT
[unit] => celcius
[value] => 3.6
)
[windDirection] => Array
(
[id] => dd
[deg] => 305.2
[name] => NW
)
[windSpeed] => Array
(
[id] => ff
[mps] => 2.2
[beaufort] => 2
[name] => Svak vind
)
[humidity] => Array
(
[value] => 90.2
[unit] => percent
)
[pressure] => Array
(
[id] => pr
[unit] => hPa
[value] => 1007.8
)
[cloudiness] => Array
(
[id] => NN
[percent] => 41.2
)
[fog] => Array
(
[id] => FOG
[percent] => 0.0
)
[lowClouds] => Array
(
[id] => LOW
[percent] => 37.6
)
[mediumClouds] => Array
(
[id] => MEDIUM
[percent] => 5.7
)
[highClouds] => Array
(
[id] => HIGH
[percent] => 0.0
)
[precipitation] => Array
(
[unit] => mm
[value] => 0.0
[minvalue] => 0.0
[maxvalue] => 0.0
)
[symbol] => Array
(
[id] => LIGHTCLOUD
[number] => 2
)
)
[1305558000] => Array
(
[date] => Array
(
[epoc] => 1305558000
[iso] => 2011-05-17T01:00:00Z
)
[temperature] => Array
(
[id] => TTT
[unit] => celcius
[value] => 6.0
)
[windDirection] => Array
(
[id] => dd
[deg] => 227.9
[name] => SW
)
[windSpeed] => Array
(
[id] => ff
[mps] => 1.6
[beaufort] => 1
[name] => Flau vind
)
[humidity] => Array
(
[value] => 90.1
[unit] => percent
)
[pressure] => Array
(
[id] => pr
[unit] => hPa
[value] => 1003.2
)
[cloudiness] => Array
(
[id] => NN
[percent] => 2.7
)
[fog] => Array
(
[id] => FOG
[percent] => 0.0
)
[lowClouds] => Array
(
[id] => LOW
[percent] => 2.7
)
[mediumClouds] => Array
(
[id] => MEDIUM
[percent] => 0.3
)
[highClouds] => Array
(
[id] => HIGH
[percent] => 0.0
)
[precipitation] => Array
(
[unit] => mm
[value] => 0.0
[minvalue] => 0.0
[maxvalue] => 0.0
)
[symbol] => Array
(
[id] => SUN
[number] => 1
)
)
)
hashbang/wunderground 适用场景与选型建议
hashbang/wunderground 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 30 次下载、GitHub Stars 达 8, 最近一次更新时间为 2014 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「weather」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hashbang/wunderground 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hashbang/wunderground 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hashbang/wunderground 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel-forecast provides a service provider and a facade around the Forecast-php wrapper
Add a weather widget to Flarum
Simple weather forecaster for Laravel
Unofficial PHP client for aWhere weather API
Anax weather module
An extremely simple PHP Weather Underground API wrapper
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-03-25