/php-maldives-weather-wrapper

Fetches the weather details from meteorology.gov.mv

Primary LanguagePHPMIT LicenseMIT

Maldives Weather Wrapper

This script fetches Weather Information from Maldives Meteorology website and displays in json format.

Requirements

Basic Usage

<?php
$dom = new simple_html_dom();
$Weather = new MvWeather($dom);

// Get Weather Summary
print_r($Weather->getSummary());

// Get Weather Details for a Location
print_r($Weather->getDetails('Gan'));

Using Example File

For your convinience I have added an example program (index.php) which returns a json feed.

  • To get weather summary: index.php
  • To get weather details for a location: index.php?location=Male

Demonstration

To-do

  • Caching