ajur-media/openweathermap-data-parser
Composer 安装命令:
composer require ajur-media/openweathermap-data-parser
包简介
A PHP class to parse weather data from OpenWeatherMap.org. This library tries to normalise and abstract the data and remove inconsistencies
关键字:
README 文档
README
A PHP class to retrieve and parse weather data from OpenWeatherMap.org.
This library aims to normalise the provided data and remove some inconsistencies. This library is neither maintained by OpenWeatherMap nor their official PHP API.
Installation
This library can be found on Packagist. The recommended way to install and use it is through Composer.
composer require ajur-media/openweathermap-data-parser
Example call
<?php use AJUR\OpenWeatherMap; use AJUR\OpenWeatherMap\Exception as OWMException; // Must point to composer's autoload file. require 'vendor/autoload.php'; // Language of data (try your own language here!): $lang = 'ru'; // Units (can be 'metric' or 'imperial' [default]): $units = 'metric'; // Create OpenWeatherMap object. // Don't use caching (take a look into Examples/Cache.php to see how it works). $owm = new OpenWeatherMap('YOUR-API-KEY'); try { $weather = $owm->getWeather('Berlin', $units, $lang); } catch(OWMException $e) { echo 'OpenWeatherMap exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').'; } catch(\Exception $e) { echo 'General exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').'; } echo $weather->temperature;
License
MIT — Please see the LICENSE file distributed with this source code for further information regarding copyright and licensing.
Please check out the following official links to read about the terms, pricing and license of OpenWeatherMap before using the service:
ajur-media/openweathermap-data-parser 适用场景与选型建议
ajur-media/openweathermap-data-parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 582 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「free」 「weather」 「OpenWeatherMap」 「owm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ajur-media/openweathermap-data-parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ajur-media/openweathermap-data-parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ajur-media/openweathermap-data-parser 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel-forecast provides a service provider and a facade around the Forecast-php wrapper
A PSR-7 compatible library for making CRUD API endpoints
Add a weather widget to Flarum
free as in freedom php component requirement
Free as in freedom php component that generates configuration based hard coded locator
Free PHP WebSocket
统计信息
- 总下载量: 582
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-24