Download the PHP package rugaard/pollen without Composer

On this page you can find all versions of the php package rugaard/pollen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pollen

🇩🇰🤧 Pollen measurements from Astma-Allergi Denmark

Astma-Allergi Denmark does unfortunately not offer an official API for the latest pollen measurements in Denmark.

This package is (in some form) a workaround for that. It fetches the latest measurements and short-term predictions directly from Astma-Allergi Denmark's data feed and turns it into structured, typed data objects.

The returned data shows the measured pollen between 13:00 (UTC +1) (1:00 PM) yesterday and 13:00 (UTC +1) (1:00 PM) present day. Every day at 16:30 (UTC +1) (4:30 PM), at the latest, the new measurements are being published.

⚠️ Disclaimer

Since Astma-Allergi Denmark is an independent union, with a very little government funding, this package is made available under a very strict license, which prohibits any use other than personal.

If you wish to use the pollen measurements commercially, you should contact Astma-Allergi Denmark directly and support them by buying the data instead. The payment goes directly to the maintenance and further development of their Pollen measurement service.

For more info about a commercial license, visit their official website.

📖 Table of contents

🖥 Requirements

📦 Installation

You can install the package via Composer, by using the following command:

Laravel

This package comes with an out-of-the-box Service Provider for the Laravel framework, which is loaded automatically via package discovery.

⚙️ Usage

First thing you need to do, is to instantiate the Pollen client:

Once you've done that, you're ready to fetch the latest measurements.

Pollen client

The Pollen client which handles the requests to Astma-Allergi Denmark.

Parameter Type Default Description
$client \GuzzleHttp\ClientInterface null Replace the default underlying HTTP client

Methods

Get measurements

Get the latest pollen measurements and predictions. Optionally filter by station and/or exclude allergens that are currently out of season.

Parameter Type Default Description
$station Station\|null null Filter by a specific pollen station. Returns all stations when null.
$onlyInSeason bool false When true, allergens that are currently out of season are excluded from the result.

Note: The returned data shows the measured pollen between 13:00 (1:00 PM) yesterday and 13:00 (1:00 PM) present day. The measurements are updated everyday at 16:00 (4:00 PM).

Examples:

Return data structure

Single station

When a $station is provided, get() returns a Collection keyed by allergen code. Each value is either a Collection with measurement data, or null if the allergen is currently out of season.

All stations

When no $station is provided, get() returns a Collection keyed by station value ('east', 'west'), where each entry contains the station's allergen measurements as described above.

🏛 Pollen stations

Currently there only exist two pollen stations in Denmark.

Enum ID Name Code Region
Station::East 48 København east East
Station::West 49 Viborg west West

🌿 Allergens

The following allergens are supported. Spore allergens do not have predictions.

Enum Code Danish name Type
Allergen::Alder alder El Pollen
Allergen::Hazel hazel Hassel Pollen
Allergen::Elm elm Elm Pollen
Allergen::Birch birch Birk Pollen
Allergen::Grass grass Græs Pollen
Allergen::Mugwort mugwort Bynke Pollen
Allergen::Alternaria alternaria Alternaria Spore
Allergen::Cladosporium cladosporium Cladosporium Spore

🖼 Icons

The assets/ folder contains a PNG icon for each allergen, named after its code.

Icon Allergen
alder
hazel
elm
birch
grass
mugwort
alternaria
cladosporium

📊 Level classification

Each allergen measurement is classified into one of five levels, represented by the Level enum. Thresholds vary per allergen.

Enum Code Danish name Description
Level::Unknown unknown ukendt No measurable pollen (count = 0)
Level::Low low lavt Below the low threshold
Level::Moderate moderate moderat Below the moderate threshold
Level::High high højt Below the high threshold
Level::VeryHigh very-high meget højt At or above the high threshold

🗣 Frequently Asked Questions (FAQ)

What is this Illuminate\Support\Collection class and how does it work?

All data is returned within an Illuminate\Support\Collection. This is the same Collection class used by the Laravel framework, available as a standalone package — so no Laravel installation is required.

Please refer to Laravel's detailed documentation to learn more about how you work with a Collection:
https://laravel.com/docs/collections

💰 Donating to Astma-Allergi Denmark

To help Astma-Allergi Denmark maintain and further develop the Pollen measurement service.
Please consider sending them a donation.

🚓 License

This package is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 (CC BY-NC-ND 4.0).

Creative Commons License


All versions of pollen with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
guzzlehttp/guzzle Version ^7.0|^8.0
illuminate/collections Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rugaard/pollen contains the following files

Loading the files please wait ...