DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
EXT: Openweather API¶
Author: | Christopher |
---|---|
Created: | 2010-12-18T19:57:23 |
Changed by: | Andreas Kastl |
Changed: | 2014-01-03T16:44:50.480000000 |
Classification: | openweatherapi |
Description: | The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) ---- |
Keywords: | weather, api, wetter.com, openweather, forEditors, forBeginners |
Author: | Andreas Kastl |
Email: | andreas.kastl@gmx.de |
Language: | en |
EXT: Openweather API¶
Extension Key: openweatherapi
Language: en
Version: 1.2.1
Keywords: weather, api, wetter.com, openweather, forEditors, forBeginners
Copyright 2006-2014, Andreas Kastl, < andreas.kastl@gmx.de >
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`EXT: Openweather API 1 <#__RefHeading__5708_1738894311>`_
`Introduction 3 <#__RefHeading__5710_1738894311>`_
`Users manual 4 <#__RefHeading__467_413120346>`_
Installation of the extension 6
`Configuration 8 <#__RefHeading__31515_818911409>`_
`Known problems 10 <#__RefHeading__31525_818911409>`_
Limitations of openweather API 10
Limitations of this extension 10
`To-Do list 11 <#__RefHeading__477_413120346>`_
`ChangeLog 12 <#__RefHeading__31623_818911409>`_
Introduction¶
What does it do?¶
This extension displays weather forecasts in a frontend plugin. The forecast information is based on the openweather API provided by wetter.com.
More information about openweather API and related terms & conditions can be found at http://www.wetter.com/apps_und_mehr/website/api/ .
Screenshots¶
The extension displays weather forecast for three days (current + 2 days):
Users manual ------------
Registration at wetter.com¶
In order to use the extension you need to create an user account and project subscription at wetter.com. First go to http://www.wetter.com/mein_wetter/register/ and create an user account:
Then log in and create a new subscription for your project at http://www.wetter.com/apps_und_mehr/website/api/projekte/ :
Please read the terms & conditions (AGB) of www.wetter.com carefully. The free API interface is currently limited to 10,000 requests per month.
After submitting the registration form you find your project name(s) and related API key(s) in the list. You will need these properties later for the configuration of the extension.
Click on the project name to configure your subscription. In section “Vorhersageeinstellungen” you can configure the amount of forecasts (“Anzahl der Vorhersagetage”, from 1 to 3 days) and the forecast attributes (“Felder der Vorhersageantwort”). Please include at least the following attributes in your forecast settings. Otherwise some fields will remain empty in frontend. Please do not forget to hit the save button at the bottom (“Vorhersageeinstellungen speichern”) to save your settings.
Installation of the extension¶
Installation of the Typo3 extension is very simple. Just download the extension from TER and install it. Then add the static TypoScript template of the openweatherapi extension to your site template:
Plugin content element ^^^^^^^^^^^^^^^^^^^^^^
Insert a content element of type “plugin” on your website and select the openweatherapi extension (Weather forecast).
Insert the corresponding values for the properties “Project name” and “API Key” from your wetter.com subscription (see section “Registration at wetter.com” above).
In the field “City Code” enter the code of the location for which you want to display the weather forecast. To find the right city code just open the URL http://www.wetter.com and perform a search for your preferred location. The city code is displayed in the result URL, e.g. for Berlin it is DE0001020:
Save your plugin and open the corresponding page in frontend. Now you should see the weather forecast for your preferred location:
Configuration -------------
FAQ¶
I get the error “Custom HTML template not found or plugin's static TypoScript not included in site config.” What should I do?¶
Make sure that you included the static template of the extension “openweatherapi” in your site template (see section “Installation of the extension“).
Another reason may be that you have overwritten the TypoScript property “templateFile” of the plugin and use your custom HTML template. In this case the plugin could not find the HTML file. Please check if the file exists.
I get the error “Weather forecast is currently not available (connection error).”. What does this mean?¶
The plugin tried to download weather data from http://api.wetter.com by using CURL since your Typo3 installation seems to prefer CURL to access external URLs. But the download was not successful.
Check if your hosting provider allows outgoing calls to http://api.wetter.com via CURL.
I get the error “Weather forecast is currently not available (data retrieval error).”. What does this mean?¶
The plugin tried to download weather data from http://api.wetter.com but did not receive a valid XML response.
Check if your hosting provider allows outgoing calls to http://api.wetter.com .
I get the error “Weather forecast is currently not available (API error).”. What does this mean?¶
The plugin tried to download weather data from http://api.wetter.com and got a valid XML response. But it did not include valid forecast data.
Check the properties of your plugin content element if these are correct, especially city code.
Some fields in frontend are missing (e.g. wind direction). Why?¶
Please check your subscription at wetter.com (see section “Registration at wetter.com”). Make sure that all required attributes are configured correctly.
Or check your custom HTML template if all relevant markers are included.
There is only one forecast rendered. How can I increase the amount of forecasts to e.g. 3 days?¶
Please check your subscription at wetter.com (see section “Registration at wetter.com”) and update the amount of forecasts in your settings.
Reference¶
Reference of TypoScript options.
templateFile¶
Property
templateFile
Data type
string
Description
Path of the HTML template file to render the frontend output. Use your own template if you want to modify the output.
Default
EXT:openweatherapi/res/template.tmpl
openweatherUrl¶
Property
openweatherUrl
Data type
string
Description
URL prefix of the openweather API forecast interface. Usually should not be changed.
Select a different URL if you use for example a separate script that fetches the XML file from wetter.com. May be useful if your hosting provider does not allow outgoing requests to http://api.wetter.com and therefore you need to bypass this restriction by a proxy script with other URL destinations.
iconUrl¶
Property
iconUrl
Data type
string
Description
Path of the icon files for the weather forecast images.
Usually should not be changed. Necessary files are provided by the extension.
Default
EXT:openweatherapi/res/
projectName¶
Property
projectName
Data type
string
Description
Optional.
Name of the project as registered at wetter.com if this should be set by TypoScript instead of plugin content element.
Default
apiKey¶
Property
apiKey
Data type
string
Description
Optional.
API key as registered at wetter.com if this should be set by TypoScript instead of plugin content element.
Default
cityCode¶
Property
cityCode
Data type
string
Description
Optional.
City code as registered at wetter.com if this should be set by TypoScript instead of plugin content element.
Default
strftime¶
Property
strftime
Data type
string
Description
Format of the date in frontend (PHP strftime syntax).
Default
%A, %d.%m.%Y
Note : the default CSS definitions for the extension are also part of the static TypoScript template of this extension. Overwrite the CSS definitions if needed.
Known problems¶
Limitations of openweather API¶
The XML data fetched from openweather API contains several attributes. The wetter.com frontend allows individual selection and deselection of attributes for each project. Please make sure that all necessary attributes are included in your subscription (see section “Registration at wetter.com”).
The amount of forecasts can also be changed for each wetter.com subscription. This setting also affects the number of forecast days displayed on your web site (see section “Registration at wetter.com”).
The XML data includes some text attributes in German language only. Wetter.com does not provide a translation for that, e.g. text of weather conditions (“leicht bewölkt”, “wolkig”, etc.).
Limitations of this extension¶
Openweather API provides all-day forecast data and individual forecast data for certain time frames per day in the XML file. The extension does not support the individual forecasts per day, e.g. 6:00 am, 11:00 am, 5:00 pm and 11:00 pm. Currently it supports only the all-day values.
The extension uses normal Typo3 caching to limit requests to openweather API service and speedup frontend rendering. If you want to update weather forecasts more often you have to either disable caching or set the cache lifetime to a shorter interval for the page that includes the plugin.
To-Do list¶
None
ChangeLog¶
1.2.1¶
Version
1.2.1
Changes
Fallback for date attribute implemented. Thanks to Patrick Finkbeiner.
1.2.0¶
Version
1.2.0
Changes
Typo3 CMS 6.x compatibility fix, status changed to stable.
1.1.0¶
Version
1.1.0
Changes
Bugfixes and completion of documentation.
1.0.0¶
Version
1.0.0
Changes
Initial version.