Code Monkey home page Code Monkey logo

openweathermap-php-api's Introduction

OpenWeatherMap PHP API

A PHP 7.1+ (including PHP 8) API to retrieve and parse global weather data from OpenWeatherMap.org. This project aims to normalise the provided data and remove inconsistencies. It is not maintained by OpenWeatherMap and not an official API wrapper.

Gitpod Ready-to-Code Build Status license release codecov Scrutinizer Quality Score

Documentation

You can find the latest documentation, including installation and usage instructions at https://cmfcmf.github.io/OpenWeatherMap-PHP-API.

Contributing

I'm happy about every pull request you open and issue you find to help make this API more awesome. Please note that it might sometimes take me a while to get back to you. Feel free to ping me if I don't respond.

Gitpod

You can use Gitpod to launch a fully functional development environment right in your browser. Simply click on the following badge:

Gitpod Ready-to-Code

Vagrant

You can use Vagrant to kick-start your development. Simply run vagrant up and vagrant ssh to start a PHP VM with all dependencies included.

Docker

You can also use Docker to start developing this library. First install dependencies:

docker run --rm --interactive --tty \
    --volume $PWD:/app \
    --user $(id -u):$(id -g) \
    composer update

And then execute the tests:

docker run --rm --interactive --tty \
    --volume $PWD:/app -w /app \
    php bash

> php vendor/bin/phpunit

Documentation

The documentation is built using Docusaurus v2. To run a local developnment server for the docs, execute

cd docs
yarn install
yarn start

License

This project is licensed under the MIT license. Please see the LICENSE file distributed with this source code for further information regarding copyright and licensing.

Be aware that the OpenWeatherMap data is not licensed under the MIT. Check out the following official links to read about the terms, pricing and license of OpenWeatherMap before using their service:

openweathermap-php-api's People

Contributors

1franck avatar andreaskweber avatar bitdeli-chef avatar chrisb9 avatar cklm avatar clpsplug avatar cmfcmf avatar dependabot[bot] avatar emimarz avatar emmanuelroecker avatar erickskrauch avatar erulezz avatar goodevilgenius avatar hevertonwinsite avatar mikepsinn avatar pablopereira27 avatar peter279k avatar peterbulmer avatar robjuz avatar roelvanhintum avatar tardypad avatar tobialbert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openweathermap-php-api's Issues

Error: Not found city

I'm getting this error more often than not today. Any idea what can be wrong? Something this works, other times it doesn't. This error didn't happen before.

Exception in OpenWeatherMap.php line 165:
Error: Not found city
in OpenWeatherMap.php line 165
at OpenWeatherMap->getWeather(array('lat' => '51.2194475', 'lon' => '4.4024643'), 'metric', 'en', 'myapikeyishere') in Inspection.php line 35

Fatal error on $owm->getWeather()

Hi Guys,

Im getting an error, when I try to get the current weather.
Im using the version: cmfcmf/openweathermap-php-api v2.1.1

OpenWeatherMap exception: Unknown fatal error: OpenWeatherMap returned the following json object: (Code 0).

My Code:

try {
   //debug code.
    $owm = new OpenWeatherMap('XXXXXXXX');
    $weather = $owm->getWeather('Berlin', 'metric', 'en');
    dd($weather);

   //real code
    $query = [
        'lat' => $organization->lat,
        'lon' => $organization->lng,
    ];

    //$weather = $owm->getWeather($query, $units, $lang);
    //dd($weather);

} catch(OWMException $e) {
    dd('OpenWeatherMap exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').');
} catch(\Exception $e) {
    dd('General exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').');
}

I also tried getting the info by url, and it worked fine:
http://api.openweathermap.org/data/2.5/weather?q=Berlin&units=metric&lang=en&mode=xml&APPID=XXXXXX

Im debugging the code and it seems there is an error here:

    public function getWeather($query, $units = 'imperial', $lang = 'en', $appid = '')
    {
        $answer = $this->getRawWeatherData($query, $units, $lang, $appid, 'xml');
        $xml = $this->parseXML($answer);
        //dd($answer, $xml); //The response here is fine!

        return new CurrentWeather($xml, $units); //here it seems to be the problem.
    }

PS:
The query by lat/long works ?

    $query = [
        'lat' => $organization->lat,
        'lon' => $organization->lng,
    ];
     //$weather = $owm->getWeather($query, $units, $lang);

Thanks.

Error when city does not exist

When you query information about an non-existing city throws an error:
Start tag expected, '<' not found

This is because openweathermap ignores the xml parameter and outputs an error in json format:
{"message":"Error: Not found city","cod":"404"}

Is there any specific reason you process XML instead of JSON?

Incorrect current weather values

hello,
I remark that the current values you get from the getweather() request are not the current ones but the ones at 06:00.

For example I made a test at 11:53 on a little French town.

$rawWeather = $owm->getRawWeatherData(['lat' => '44.178299', 'lon' => ''3.4298'], 'metric', $language, $OpenWeatherApiKey, 'json');

result from is : (notice temperature of 6.6)

\src\Controller\DeviceconnectionsController.php (line 395)

[
'coord' => [
'lon' => (float) 3.36,
'lat' => (float) 44.22
],
'sys' => [
'type' => (int) 3,
'id' => (int) 59713,
'message' => (float) 0.0484,
'country' => 'FR',
'sunrise' => (int) 1425881346,
'sunset' => (int) 1425923097
],
'weather' => [
(int) 0 => [
'id' => (int) 800,
'main' => 'Clear',
'description' => 'ensoleillé',
'icon' => '01d'
]
],
'base' => 'cmc stations',
'main' => [
'temp' => (float) 6.6,
'temp_min' => (float) 6.6,
'temp_max' => (float) 6.6,
'pressure' => (float) 1038.49,
'humidity' => (int) 40
],
'wind' => [
'speed' => (float) 1.06,
'deg' => (float) 355.001
],
'clouds' => [
'all' => (int) 0
],
'dt' => (int) 1425896398,
'id' => (int) 6449384,
'name' => 'Meyrueis',
'cod' => (int) 200
]

Remark that you get these values from forecast request:
$rawForecastDatas = $owm->getRawHourlyForecastData(['lat' => '44.178299', 'lon' => '3.4298', 'metric', $language, $OpenWeatherApiKey, 'json');

result is: (notice temperature of 6.6 at 06:00)
[
(int) 0 => [
'dt' => (int) 1425891600,
'main' => [
'temp' => (float) 6.6,
'temp_min' => (float) 6.6,
'temp_max' => (float) 6.6,
'pressure' => (float) 1038.49,
'sea_level' => (float) 1038.49,
'grnd_level' => (float) 1038.49,
'humidity' => (float) 40,
'temp_kf' => (float) 0
],
'weather' => [
(int) 0 => [
'id' => (int) 800,
'main' => 'Clouds',
'description' => 'clear sky',
'icon' => '01d'
]
],
'clouds' => [
'all' => (float) 0
],
'wind' => [
'speed' => (float) 1.06,
'deg' => (float) 355.001
],
'sys' => [
'pod' => 'd'
],
'dt_txt' => '2015-3-9 09:00:00'
],
(int) 1 => [
'dt' => (int) 1425913200,
'main' => [
'temp' => (float) 19.82,
'temp_min' => (float) 14.97,
'temp_max' => (float) 19.82,
'pressure' => (float) 929.16,
'sea_level' => (float) 1036.88,
'grnd_level' => (float) 929.16,
'humidity' => (int) 34,
'temp_kf' => (float) 4.86
],
'weather' => [
(int) 0 => [
'id' => (int) 800,
'main' => 'Clear',
'description' => 'ensoleillé',
'icon' => '01d'
]
],
'clouds' => [
'all' => (int) 0
],
'wind' => [
'speed' => (float) 1.76,
'deg' => (float) 5.00757
],
'sys' => [
'pod' => 'd'
],
'dt_txt' => '2015-03-09 15:00:00'
],

But from openWeatherMap website, the current temperature was:
xeuxmkx

and if I made a request directly:

http://api.openweathermap.org/data/2.5/weather?q=Meyrueis,fr
returned values are:
{"coord":{"lon":3.43,"lat":44.18},"sys":{"message":0.0486,"country":"France","sunrise":1425881328,"sunset":1425923081},"weather":[{"id":800,"main":"Clear","description":"Sky is Clear","icon":"01d"}],"base":"cmc stations","main":{"temp":286.787,"temp_min":286.787,"temp_max":286.787,"pressure":930.1,"sea_level":1038.49,"grnd_level":930.1,"humidity":40},"wind":{"speed":1.06,"deg":355.001},"clouds":{"all":0},"dt":1425898863,"id":6449384,"name":"Meyrueis","cod":200}

We see here that temp=286.787 - 273.15 = 13.6°C

So it seems there is something wrong in you api.

Hope this help.
regards,

OpenWeatherMap.php on line 243 error

Hi,

I have currently this error :

Fatal error: Uncaught exception 'Cmfcmf\OpenWeatherMap\Exception' with message 'Unknown fatal error: OpenWeatherMap returned the following json object: ' in C:\wwwroot\html\meteo\vendor\cmfcmf\openweathermap-php-api\Cmfcmf\OpenWeatherMap.php:243 Stack trace: #0 C:\wwwroot\html\meteo\weather.php(23): Cmfcmf\OpenWeatherMap->getWeatherForecast('Marseille', 'metric', 'fr', '3912cfdc0ea36bd...', 16) #1 C:\wwwroot\html\meteo\index.php(10): include('C:\\wwwroot\\html...') #2 {main} thrown in C:\wwwroot\html\meteo\vendor\cmfcmf\openweathermap-php-api\Cmfcmf\OpenWeatherMap.php on line 243

How can i solve it ?

Thanks

How can i add a icon at the forcast?

I got this code

foreach ($forecast as $weather) {
    // Each $weather contains a Cmfcmf\ForecastWeather object which is almost the same as the Cmfcmf\Weather object.
    // Take a look into 'Examples_Current.php' to see the available options.
    echo "Weather forecast at " . $weather->time->day->format('d F Y');
    echo "<br />\n";
    echo $weather->temperature;
    echo $weather->icon;
    echo "<br />\n";
    echo "<br />\n";
}

In my mind $weather->icon; should work?

Order weather forecast by timestamp

On some cities when try to get data on 16 day returned 10 days of forecast and after this 6-2 weather data of past days. When go by foreach on data graph is broken. This is bug of API, but can you order data by timestamp when parsing it?

Fatal error on fetch()

Is there any easy fix to this?

Fatal error: Call to a member function fetch() on string in /Users/kyle/Sites/koma/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap.php on line 551

error temp max y min

I get an error when setting the max and min temperature together with the temperature gives me the same value.
$miclima = array(
'temp' => $weather->temperature->now,
'tmin' => $weather->temperature->min,
'tmax' => $weather->temperature->max,
'hum' => $weather->humidity,
'vel' => $weather->wind->speed,
'dir' => $weather->wind->direction
);

Forecast functionality added!

I just wanted to tell you that I added forecast functionality today!

However I know it is not that well documented yet.

$lang parameter broken

I have copied your CurrentWeather example directly to my web-server so i could see how the api works. In the beginning you set the parameter to de which should be German but at example 7 the output for wind direction and wind speed description are in English.

language code doesn't work

hello,
I tried to call $weather = $owm->getWeather('Mende, Fr', 'metric', $lang); with $lang = 'fr', 'de', same, i always get the result in English.
Certainly a problem of parameter passed in the url because if I directly access to openWeather, I get translated results.

[Insight] Unused use statement should be avoided - in Cmfcmf/OpenWeatherMap/Forecast.php, line 21

in Cmfcmf/OpenWeatherMap/Forecast.php, line 21

The class Cmfcmf\OpenWeatherMap\Util\City is declared but never used. You should remove the use statement.

 */

namespace Cmfcmf\OpenWeatherMap;

use Cmfcmf\OpenWeatherMap;
use Cmfcmf\OpenWeatherMap\Util\City;
use Cmfcmf\OpenWeatherMap\Util\Sun;
use Cmfcmf\OpenWeatherMap\Util\Temperature;
use Cmfcmf\OpenWeatherMap\Util\Time;
use Cmfcmf\OpenWeatherMap\Util\Unit;
use Cmfcmf\OpenWeatherMap\Util\Weather as WeatherObj;

Posted from SensioLabsInsight

Forecast Wind direction parsing issue

Current code uses 'value' xml option field for getting wind direction whereas the xml contains the field 'deg' (which is in fact different from the current weather response...)

Fix is simply to change 'value' to 'deg' in OpenWeatherMap/Forecast.php line 70

Thanks for your library

Feature Request - HTML View

Hey Man, Any tips on how to get the html view working , I dug abit deeper into your library (dont really want to edit the core files.

Lee

[Insight] Text files should end with a newline character - in Examples/WeatherHistory.php, line 44

in Examples/WeatherHistory.php, line 44

This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

// Example 1: Get hourly weather history between 2014-01-01 and today.
$history = $owm->getWeatherHistory('Berlin', new \DateTime('2014-01-01'), new \DateTime('now'), 'hour', $units, $lang);

foreach ($history as $weather) {
    echo "Average temperature at " . $weather->time->format('d.m.Y H:i') . ": " . $weather->temperature . "\n\r<br />";
}

Posted from SensioLabsInsight

Daily forecast temperature is calculated incorretly

When a Forecast object is constructed, it calculates the value for the Temperature->now as the average of the minimum and maximum from the temperature values in the XML message. However, because all values are strings but no conversion to floats is done, the temp values are cast to integers and the resulting average is incorrect.

Ideas for future versions

Cleanup and Minor Features

  • Remove deprecated methods and constructor arguments from the OpenWeatherMap class
  • Change &deg; C back to °C (The API should not be HTML aware.)
  • Add better error handling
  • Make sure to handle invalid data from OWM properly (#100)
  • #131
  • Remove population field from City.
  • Remove $appid from all methods except constructor
  • Split forecast apis into two methods (no more magic depending on the number of requested days)
  • Rename temperature->current to temperature->avg
  • Split up Temperature class into separate class for 16 day forecast
  • Merge getCurrentWeather() and getCurrentWeatherGroup()

Documentation

  • Remove Examples and write a proper documentation instead #98
  • Document all the OWM bugs this API fixes

Tests

  • Achieve 100% test code coverage
    • Find a tool to create a mock api server
    • Integrate mock api server

New Features


You are welcome to propose further (backwards incompatible) changes.

[Insight] Object parameters should be type hinted - in Cmfcmf/OpenWeatherMap/CurrentWeather.php, line 96

in Cmfcmf/OpenWeatherMap/CurrentWeather.php, line 96

The parameter xml, which is an object, should be typehinted.

     * @param        $xml
     * @param string $units
     *
     * @internal
     */
    public function __construct($xml, $units)
    {
        $this->city = new City($xml->city['id'], $xml->city['name'], $xml->city->coord['lon'], $xml->city->coord['lat'], $xml->city->country);
        $this->temperature = new Temperature(new Unit($xml->temperature['value'], $xml->temperature['unit']), new Unit($xml->temperature['min'], $xml->temperature['unit']), new Unit($xml->temperature['max'], $xml->temperature['unit']));
        $this->humidity = new Unit($xml->humidity['value'], $xml->humidity['unit']);
        $this->pressure = new Unit($xml->pressure['value'], $xml->pressure['unit']);

Posted from SensioLabsInsight

unable to install

php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package cmfcmf/openweathermap-php-api 1.0.0 could not be found.

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

{
"name": "cmfcmf/openweathermap-php-api",
"description": "A php api to parse weather data from OpenWeatherMap.org. This api tries to normalise and abstract the data and remove inconsistencies.",
"keywords": ["weather", "OpenWeatherMap", "weather api"],
"homepage": "https://github.com/cmfcmf/OpenWeatherMap-PHP-Api",
"license": "MIT",
"authors": [
{
"name": "Christian Flach (cmfcmf)",
"email": "[email protected]",
"homepage": "http://cmfcmf.github.io",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/issues",
"source": "https://github.com/cmfcmf/OpenWeatherMap-PHP-Api.git"
},
"require": {
"php": ">=5.3.0",
"cmfcmf/openweathermap-php-api": "~2.0"
},
"autoload": {
"psr-0": {
"Cmfcmf": ""
}
}
}

[Insight] Unused use statement should be avoided - in Cmfcmf/OpenWeatherMap/Forecast.php, line 22

in Cmfcmf/OpenWeatherMap/Forecast.php, line 22

The class Cmfcmf\OpenWeatherMap\Util\Sun is declared but never used. You should remove the use statement.

namespace Cmfcmf\OpenWeatherMap;

use Cmfcmf\OpenWeatherMap;
use Cmfcmf\OpenWeatherMap\Util\City;
use Cmfcmf\OpenWeatherMap\Util\Sun;
use Cmfcmf\OpenWeatherMap\Util\Temperature;
use Cmfcmf\OpenWeatherMap\Util\Time;
use Cmfcmf\OpenWeatherMap\Util\Unit;
use Cmfcmf\OpenWeatherMap\Util\Weather as WeatherObj;
use Cmfcmf\OpenWeatherMap\Util\Wind;

Posted from SensioLabsInsight

API key is now mandatory

According to http://openweathermap.org/appid, the API key is now required to make the API calls whether you have a free or paid for account. This means that the api key must be passed to each getWeather() since the default is NULL.
It's not a bug at this point since there is a way around it by explicitly passing the api key to every call, but it does break the Examples. It's probably a good idea to add the addition parameter to the OpenWeatherMap() constructor to set the default api key in the class and then use it as the default in all the other methods, unless overridden.

Code 404 problem

Hey, I get this error "OpenWeatherMap exception: (Code 404)". Is it because I'm doing something wrong or is it the service? I'm new to using apis so go easy on me lol

If you need to see my code just say so.

Thanks for any help :)

Unable to install using Composer!

{
"require" : {
    "facebook/php-sdk-v4" : "~5.0",
    "twbs/bootstrap": "^3.3",
    "phpclasses/choroscope": ">=1.0.0",
     "cmfcmf/openweathermap-php-api": "~2.0"
     },
  "repositories":
  [
    {
      "type": "composer",
      "url": "http:\/\/www.phpclasses.org\/"
    },
    {
      "packagist": false
    }
  ]
}

This is my composer.json file, and I'm getting errors

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package cmfcmf/openweathermap-php-api could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Please guide me.

Expected DateTime object give the SimpleXMLElement

$owm->getWeatherForecast(..., 5) // Hourly Forecast

causes an error

Call to undefined method SimpleXMLElement::format()
/home/jstawowy/www/center/laravel/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Time.php on line 52

$from is a SimpleXMLElement object

$owm->getWeatherForecast(..., 14) // Daily Forecast

causes an error

Call to undefined method SimpleXMLElement::add()
/home/jstawowy/www/center/laravel/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Time.php on line 57

$to is a SimpleXMLElement object

Question, possible bug

Hello,
I;m using the multiple days forecast query. WHen I do like this, it works perfect:

$forecast = $owm->getWeatherForecast($info->name, $units, $lang, Config::get('app.owmapi'), $days);

But, when I try to do it, by lat/lon, is gives me an error...

$forecast = $owm->getWeather($query = array('lat' => $info->latitude, 'lon' => $info->longitude), $units, $lang, Config::get('app.owmapi'), $days); 

Can you please wheater is a bug, or I'm missing something, because there was no lat/lng query based example.

Thanks in advance

convert hPa to mmHg

Good day. How can i change hPa to mmHg?
I know that this must be like a $pressure = $pressure * 0.75006375541921;
but I can not find where this variable is set to count it.

New url for historical datas

Hello,

The url to access Historical Datas from OWM API is broken in Cmfcmf/OpenWeatherMap.php (line 68).
private $weatherHistoryUrl = 'http://api.openweathermap.org/data/2.5/history/city?';

You should use the new url :
private $weatherHistoryUrl = 'http://history.openweathermap.org/data/2.5/history/city?';

Regards

Add Timezone

Please Add timezone for Sunrise and Sunset.

The DateTimezone for the OWM Api is GMT but for the right Sunrise and Sunset Datetime we need the correct Timezone.

sunrise and sunset times timezones incorrectly handled

Sunrise and sunset times from owm appear to be ISO8601 formatted times (at least loosely), but they don't specify a timezone (they are UTC).
When datetime objects are created from these timestamps, no timezone is explicitly specified, and php assumes it's my localtime.

@note & Symfony2

Hi and thanks a lot for this great work !
I noticed a weird bug when using with Symfony2.

When I do something like hereunder (in a controller),

// Language of data (try your own language here!):
        $lang = $request->getLocale();

        // Units (can be 'metric' or 'imperial' [default]):
        $units = 'metric';


        $owm = new OpenWeatherMap();

        try {
            $weather = $owm->getWeather($city, $units, $lang);
        } catch(OWMException $e) {
            echo 'OpenWeatherMap exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').';
            echo "<br />\n";
        } catch(\Exception $e) {
            echo 'General exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').';
            echo "<br />\n";
        }

        return $weather;

I got this error :

[Semantical Error] The annotation "@note" in method Cmfcmf\\OpenWeatherMap\\Util\\Unit::getFormatted() was never imported. Did you maybe forget to add a "use" statement for this annotation?

It seems that the @note annotations are interpreted as standard Symfony annotations...
If I remove the @note, everything work as expected !

Thanks a lot !

Gerfaut

Unknown Fatal Error

Hi,
I very often get a OWMExceptionexception 'Cmfcmf\OpenWeatherMap\Exception' with message 'Unknown fatal error: OpenWeatherMap returned the following json object: ' in C:...\openweathermap-php-api\Cmfcmf\OpenWeatherMap.php:168

When I call $owm->getRawHourlyForecastData(), immediately followed by $owm->getWeather().
The order of calls doesn't matter. I think that something goes wrong when the owm calls are too close.

I tried to insert a sleep(2) between the 2 calls without success... I wondered if openWeather() could limit the time between 2 requests but as it's 3000 req/min in free account. I don't think that the problem could be here.

Any idea?

Installation on shared server

Really useful for a great free service.

I can install on a local host / dedicated server with root access but we have a shared server we need to install on. Using Composer other packages can be installed but the hosting company is telling me that OpenWeatherMap-PHP-Api requires root access.

I'm no composer expert, but is this correct and is there a way around it?

dead link

The copyright link in the readme.md is dead

I am missing an example with icon usage

The weather icon ID is available, but as for now I did not find any examples that are using icons. However, this lead me to having problems finding out how to use the icons that are called. I could dig a lot deeper to find out, but wouldn't it be better to have an example at Examples/CurrentWeather.php?

Example/Cache.php

Hi,
I have another one :(

I tried to used to cache ... but I got this.

Fatal error: Uncaught exception 'Exception' with message 'Class 100 does not exist.' in D:\xampp\htdocs\snowboard-ski-resorts\vendor\cmfcmf\openweathermap-php-api\Cmfcmf\OpenWeatherMap.php:93 Stack trace: #0 D:\xampp\htdocs\snowboard-ski-resorts\vendor\cmfcmf\openweathermap-php-api\Examples\Cache.php(73): Cmfcmf\OpenWeatherMap->__construct('ExampleCache', 100) #1 {main} thrown in D:\xampp\htdocs\snowboard-ski-resorts\vendor\cmfcmf\openweathermap-php-api\Cmfcmf\OpenWeatherMap.php on line 93

image

WeatherForecast.php

Hi,

I just inserted this for my Laravel website. It's a great package, but unfortunately I get an error when I try to obtain data for multi-day forecast.

Anybody might have a solution for this ?

Fatal error: Call to undefined method SimpleXMLElement::add() in D:\xampp\htdocs\snowboard-ski-resorts\vendor\cmfcmf\openweathermap-php-api\Cmfcmf\OpenWeatherMap\Util\Time.php on line 57

image

Typo in php-unit version requirement

Hello,

It seems the php-unit version number is a little incorrect. The ^ operator requires a full version - ^4.7.0 for example, rather than the configured ^4.7 version, which is actually failing when I try to build a project. Any chance you could update this?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.