This extension provides a wrapper for the library OpenWeatherMap-PHP-Api (GitHub).
It allows developers to use the library in their TYPO3 extension without much hassle.
The library uses the TYPO3 caching framework and TYPO3’s own methods to fetch URLs.
This extension does not have any major requirements
- PHP 5.3-7.2
- TYPO3 CMS 6.2 up to 8LTS (8.7)
- TYPO3 should obviously be able to access the internet
Just install the extension from the TER or manually.
Some basic configuration needs to be done:
- You need an AppID / API Key from openweathermap.org. Enter this AppID in the extension configuration inside the extension manager.
- Optionally change the cache lifetime in the extension configuration.
Get an instance of the service and the actual API class:
/** @var \RauchF\OpenweathermapPhpApiService\Service\OpenweathermapPhpApiService $owmService */
$owmService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceService('openweathermap_php_api');
$owmApi = $owmService->getOpenweathermapPhpApi();
Now you can use any API method:
$weatherData = $owmApi->getRawWeatherData(
$query,
'metric',
'en',
$owmService->getApiKey(),
'json'
);
Please report any bugs and issues you may encounter on GitHub.
The source code and usage are covered under the following licenses:
(c) 2015 Felix Rauch
This product is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.
Copyright (c) 2013 Christian Flach
MIT — Please see the LICENSE file distributed with the source code for further information regarding copyright and licensing.
Please check out the following links to read about the usage policies and the license of OpenWeatherMap before using the service.