Google Weather plugin
Posted: August 24th, 2011, 1:18 pm
Hi
I needed a weather plugin. Yahoo's doesn't show correctly on my location, BBC's not working, and couldn't find any for the Google Weather API, so... I made one!
What it does:
It supports any location and language supported by google weather, and can return current condition and forecasts up to 3 days in the future. Can show temperature of current conditions in either Celcius or Farenheit.
What is does not:
It doesn't allow the user to select Celcius or Farenheit for the Min and Max temperature forecasts. This is linked to the language used (Ex.: If you choose language EN, it returns temp in Farenheit. If you choose PT, it return in Celcius).
What is doesn't do yet:
Currently it refreshes it's information with google weather api every 15 minutes. This setting will be configurable as soon as I have the time for it, or if someone asks for it.
Instalation:
Just copy the file gweather.dll to the plugin folder in your LCD Smartie directory.
Usage:
$dll(gweather,1,<location>#<language>,<field>+<dayoffset)
Location:
Can be any accepted by google, either a postal code (for US locations) or a city (for everybody).
If the name of the city has spaces between them, they should be replaced by the + character
Language:
Again, any accepted by google, in the ISO 639-1 format (see yours in the following table: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
Field:
There are two types of fields: The ones that accept a day offset (to specify the day of the desired forecast), and the ones that don't. All of them are case insensitive:
Day Offset not required:
PostalCode -> return the same location indicated by you (not very usefull, I now)
City -> returns the full city name, as understood by google
Date -> returns the date the forecast was made
DateTime -> returns current date and time
CurrentCondition -> returns current condition text
Ftemp -> returns current temperature in farenheit
Ctemp -> returns current temperature in celcius
Humidity -> returns current humidity percentage
Icon -> returns a link for the current condition icon (gif)
Wind -> returns current wind conditions
Day Offset required:
WeekDay - returns the day of the week initials (3 characters) of the day of choice
LowTemp - returns the lowest temperature expected for the day of choice
HighTemp - returns the highest temperature expected for the day of choice
FIcon - returns a link for the forecast conditions icon for the day of choice (gif)
Condition - returns condition text for the day of choice
Day Offset:
This specifies the day of the forecast conditions we want:
+0 - The forecast conditions of the present day (default: used if no day offset is specified on the fields that need it)
+1 - The forecast conditions of tomorrow
+2 - The forecast conditions of two days from now
+3 - The forecast conditions of three days from now
Examples:
$dll(gweather,1,Lisbon#Pt,CurrentCondition) --> Returns current condition in Lisbon, in portuguese
$dll(gweather,1,New+York#En,CurrentCondition) --> Returns current condition in New York, in english
$dll(gweather,1,Paris#It,Condition+1) --> Returns forecast condition for tomorrow in Paris, in italian
Hope you find this usefull...
Nuno Picado
I needed a weather plugin. Yahoo's doesn't show correctly on my location, BBC's not working, and couldn't find any for the Google Weather API, so... I made one!
What it does:
It supports any location and language supported by google weather, and can return current condition and forecasts up to 3 days in the future. Can show temperature of current conditions in either Celcius or Farenheit.
What is does not:
It doesn't allow the user to select Celcius or Farenheit for the Min and Max temperature forecasts. This is linked to the language used (Ex.: If you choose language EN, it returns temp in Farenheit. If you choose PT, it return in Celcius).
What is doesn't do yet:
Currently it refreshes it's information with google weather api every 15 minutes. This setting will be configurable as soon as I have the time for it, or if someone asks for it.
Instalation:
Just copy the file gweather.dll to the plugin folder in your LCD Smartie directory.
Usage:
$dll(gweather,1,<location>#<language>,<field>+<dayoffset)
Location:
Can be any accepted by google, either a postal code (for US locations) or a city (for everybody).
If the name of the city has spaces between them, they should be replaced by the + character
Language:
Again, any accepted by google, in the ISO 639-1 format (see yours in the following table: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
Field:
There are two types of fields: The ones that accept a day offset (to specify the day of the desired forecast), and the ones that don't. All of them are case insensitive:
Day Offset not required:
PostalCode -> return the same location indicated by you (not very usefull, I now)
City -> returns the full city name, as understood by google
Date -> returns the date the forecast was made
DateTime -> returns current date and time
CurrentCondition -> returns current condition text
Ftemp -> returns current temperature in farenheit
Ctemp -> returns current temperature in celcius
Humidity -> returns current humidity percentage
Icon -> returns a link for the current condition icon (gif)
Wind -> returns current wind conditions
Day Offset required:
WeekDay - returns the day of the week initials (3 characters) of the day of choice
LowTemp - returns the lowest temperature expected for the day of choice
HighTemp - returns the highest temperature expected for the day of choice
FIcon - returns a link for the forecast conditions icon for the day of choice (gif)
Condition - returns condition text for the day of choice
Day Offset:
This specifies the day of the forecast conditions we want:
+0 - The forecast conditions of the present day (default: used if no day offset is specified on the fields that need it)
+1 - The forecast conditions of tomorrow
+2 - The forecast conditions of two days from now
+3 - The forecast conditions of three days from now
Examples:
$dll(gweather,1,Lisbon#Pt,CurrentCondition) --> Returns current condition in Lisbon, in portuguese
$dll(gweather,1,New+York#En,CurrentCondition) --> Returns current condition in New York, in english
$dll(gweather,1,Paris#It,Condition+1) --> Returns forecast condition for tomorrow in Paris, in italian
Hope you find this usefull...
Nuno Picado