Let's begin
Drupal 7.x release will be ready as soon as the 6.x stable will be released (beta2 right now).
AccuWeather module allows users to show a detailed weather grabbed from AccuWeather.com via three ways right now:
-
full detailed current and forecast weather page, with a location search form,
-
general users block,
-
user's block with a location grabbed from their profile's location (via "Profile" either "Content Profile" module's fields)
Notification: if an user location appears more than once as the same name, user is announced about this fact, location possibilities list will show up and user is obliged to select his appropriate location.
Unfortunately, AccuWeather weather data is beeing released only in English, so other languages weather description should be translated manually.
Features
-
easy-theming via *.tpl.php files,
-
each 15-minutes weather data cache refresh (either on CRON run or on user visit, if cache is expired),
-
predefined CSS stylesheet (can be disabled in settings form),
-
user location weather beeing displayed according to an user location field (via "Profile" or "Content Profile" module's fields),
-
storing last searched location in browser's COOKIES,
-
metric/imperial units (condigurable in settigns form),
-
configurable forecast days amount displayed in both page and blocks,
-
fancy icons;)
Configuration
Settings form is available at Site configuration › AccuWeather settings.
Blocks available as default, in block management page.
Requirements
For developers
Module has implemented it's own hook to pass through location search results. As the example would be removing all results except website location country via continent code and country ISO short-code:
/**
* Implementation of hook_accuweather_locations().
*/
function MYMODULE_accuweather_locations($op = 'list', &$data = array()) {
foreach ($data['locations'] as $index => $location) {
if (substr($location, 0, 6) == 'EUR|UK') {
$continue = TRUE;
}
}
if ($continue) {
foreach ($data['locations'] as $index => $location) {
$data['items'][$index] = str_replace('(', ' (', $data['items'][$index]);
if (substr($location, 0, 6) != 'EUR|UK') {
unset($data['locations'][$index], $data['items'][$index]);
}
}
}
return $data;
}
I suppose, that the method above will be done as a configurable feature in the settings form in the next (2.0) release.
Download
http://drupal.org/project/accuweather
Demo (websites in Polish language)
http://www.bukaciarnia.pl/pogoda
http://www.milikowice.pl/pogoda
Comments
This entry has no comments yet
Leave a comment