pion/metno 问题修复 & 功能扩展

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

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

pion/metno

最新稳定版本:1.0.1

Composer 安装命令:

composer require pion/metno

包简介

MET.no API library for fetching weather forecast

README 文档

README

Small library for getting forecast for given coordinates. Updated to newest API, originally made in 2012.

Endpoint: http://api.met.no/weatherapi/ Endpoint version: 1.8

Usage

Basic usage you can find in example.php

You can install this library via composer or download the classes and to load all the classes you can use loader_METno.php

Add to composer require

"pion/metno": ">=1.0.0"

For best clean of cached xml files use a cron with sh script like this (delete files older than 1 day):

find _METcache/ -mtime +1 -type f -delete

METnoDay

This class represents the forecast for the day. It has several properties you can access. By default the symbol and values is taken from the highest temperature, you can also set the hour which should be used.

The day has also forecast for every day (represented by METnoForecast class). When API has missing hour, the parsing will ensure that the hour will be filled by previous/next value.

Also you can access night forecast, hour forecast for highest or lowest temperature.

Custom settings

All custom settings can be made in METnoFactory via setters. You can change the class of the symbol (representing the forecast icon) and percipitation (representing values)

TODO

Possible features that could be made

METno

  • info abaout location, should be added to METnoDay too
  • time by location
  • detection of night by sunset (currently detection is made by hour)

METnoDay

  • mornig forecast
  • correct hour symbol from the form

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

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