PHPackages                             mathsgod/hl-weather - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mathsgod/hl-weather

Abandoned → [mathsgod/hko-weather](/?search=mathsgod%2Fhko-weather)Library[Utility &amp; Helpers](/categories/utility)

mathsgod/hl-weather
===================

Hong Kong weather forecast

2.0.2(5y ago)092proprietaryPHP &gt;=5.6

Since Nov 6Compare

[ Source](https://github.com/mathsgod/hl-weather)[ Packagist](https://packagist.org/packages/mathsgod/hl-weather)[ RSS](/packages/mathsgod-hl-weather/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (1)Versions (9)Used By (2)

[![PHP Composer](https://github.com/mathsgod/hl-weather/workflows/PHP%20Composer/badge.svg)](https://github.com/mathsgod/hl-weather/workflows/PHP%20Composer/badge.svg)

hl-weather
==========

[](#hl-weather)

> ⚠️ **This package is abandoned.** Please use [mathsgod/hko-weather](https://github.com/mathsgod/hko-weather) instead.
>
> ```
> composer require mathsgod/hko-weather
> ```

A PHP library for fetching Hong Kong weather forecasts from the [Hong Kong Observatory Open Data API](https://data.weather.gov.hk/weatherAPI/doc/HKO_Open_Data_API_Documentation.pdf).

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- Composer

Installation
------------

[](#installation)

```
composer require mathsgod/hl-weather
```

Usage
-----

[](#usage)

```
use HL\Weather;

// English (default)
$w = new Weather();
print_r($w->forecast());

// Traditional Chinese
$w = new Weather('tc');
print_r($w->forecast());

// Simplified Chinese
$w = new Weather('sc');
print_r($w->forecast());
```

### forecast() return format

[](#forecast-return-format)

Each entry in the returned array contains:

KeyDescription`date`Date in `YYYY-MM-DD` format`low`Minimum temperature`high`Maximum temperature`unit`Temperature unit (e.g. `C`)`forecastWind`Wind description`forecastWeather`Weather description`forecastIcon`Weather icon codeReturns 9 days of forecast data.

### Example output

[](#example-output)

```
Array
(
    [0] => Array
        (
            [date] => 2026-03-18
            [low] => 21
            [high] => 26
            [unit] => C
            [forecastWind] => East force 2 to 3.
            [forecastWeather] => Mainly cloudy. One or two light rain patches at first. Warm with sunny periods during the day. Coastal mist at night.
            [forecastIcon] => 51
        )

    [1] => Array
        (
            [date] => 2026-03-19
            [low] => 21
            [high] => 27
            [unit] => C
            [forecastWind] => Light winds force 2.
            [forecastWeather] => Sunny periods. Coastal fog in the morning. Rather warm during the day.
            [forecastIcon] => 83
        )

    ...
)

```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~151 days

Recently: every ~226 days

Total

7

Last Release

2130d ago

Major Versions

1.0.16 → 2.0.02019-06-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18732337?v=4)[Raymond](/maintainers/mathsgod)[@mathsgod](https://github.com/mathsgod)

---

Top Contributors

[![mathsgod](https://avatars.githubusercontent.com/u/18732337?v=4)](https://github.com/mathsgod "mathsgod (22 commits)")[![HostLinkUser](https://avatars.githubusercontent.com/u/23697872?v=4)](https://github.com/HostLinkUser "HostLinkUser (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mathsgod-hl-weather/health.svg)

```
[![Health](https://phpackages.com/badges/mathsgod-hl-weather/health.svg)](https://phpackages.com/packages/mathsgod-hl-weather)
```

###  Alternatives

[graze/data-structure

Data collections and containers

12295.9k10](/packages/graze-data-structure)[joungkyun/ereg-extension-wrapper

pure PHP EREG extension wrapper

102.9k](/packages/joungkyun-ereg-extension-wrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
