Download the PHP package andreaskastl/openweatherapi without Composer
On this page you can find all versions of the php package andreaskastl/openweatherapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andreaskastl/openweatherapi
More information about andreaskastl/openweatherapi
Files in andreaskastl/openweatherapi
Package openweatherapi
Short Description Displays weather forecast for a selected location in frontend based on wetter.com openweather API
License GPL-2.0-or-later
Informations about the package openweatherapi
Typo3 Extension openweatherapi
Introduction
Displays weather forecast for a selected location in frontend based on api.wetter.com (openweather API).
Please note:
- This extension is based on the free XML API that was/is provided by api.wetter.com directly.
- Wetter.com does not offer the XML API to new customers. The admin interface on the website is not available any more. The API endpoints seem to be still active for existing subscriptions.
- As announced here https://www.wetter.com/apps_und_mehr/website/api/ (12/2020): wetter.com offers a new REST API via Rapid API. This extension does not support this new REST API yet.
Administration
Installation
The extension needs to be installed as any other extension of TYPO3 CMS. Get the extension
- Get it from the Extension Manager: Press the Retrieve/Update button and search for the extension key
openweatherapi
and import the extension from the repository. - Get it from typo3.org: You can always get current version from https://extensions.typo3.org/extension/openweatherapi/ by downloading either the t3x or zip version. Upload the file afterwards in the Extension Manager.
The extension ships some TypoScript code which needs to be included and configured.
- Switch to the root page of your site.
- Switch to the Template module and select Info/Modify.
- Press the link Edit the whole template record and switch to the tab Includes.
- Select Openweather API - Weather Forecast at the field Include static (from extensions).
Users Manual
Creating a Plugin Content Element
To show the weather forecast on a page:
- Switch to the Page view module
- Create a new page or select an existing page
- Create a new content element and in the “new content element wizard” scroll down to the plugins section and select “Weather Forecast”
- Switch to the Plugin tab, and enter the required fields based on your wetter.com API subscription:
- Project Name
- API Key
- City Code
- Save the new plugin configuration.
- Switch to the frontend and validate if the plugin is working correctly.
Please note:
- When you open the frontend page with the plugin for the first time or after a change on the page, the API call to wetter.com is performed and data is fetched.
- When you or another user loads the same page again, the API call is not performed again, since the content is already cached in Typo3 CMS.
- The API will be called again after page cache expired (e.g. after 24 h). You can finetune the caching behaviour and API reloads. Edit the page record and switch to "Behaviour" tab. Select the proper setting in field "Caching/Cache lifetime"
Configuration
Custom Templates
To customize the frontend output, define your own template and overwrite the template path in the constants section of the template module: plugin.tx_openweatherapi.view.templateRootPath
To customize date / time formats, overwrite the Typoscript setting in the setup section of the template module: plugin.tx_openweatherapi.settings.strftime = %A, %d.%m.%Y