Weather forecast Portlet

Requirements

Requirements to use this portlet:

  • (Required) Getting weather forecast data. Open an account in https://darksky.net and get a secret key
  • (Optional) Getting coordinates using Google Maps. Open an account in https://maps.google.es and get a secret key

Settings

In the portlet settings you can:

  • (Required) Set up the coordinates of the area you want to see the weather forecast
  • Set up degrees unit and wind unit to use (celsius vs fahrenheit; kph vs mph)
  • Set up proxy parameters if you are using one
  • Set up time interval between requests to DarkSky API
  • Add UI freemarker templates using Liferay ADT

User interface

This portlet has 2 templates to show a preview of what you can get. If you want to see all data which is available, add a new template and print the variable ${darkSky} in order to see it.

Data model

Data model object of ${darkSky} is the equivalent to the json response (See https://darksky.net/dev/docs/response)

Source code

https://github.com/majulvez/weather-forecast . You can contribute to this project with your own templates.

Feedback

If you've got any suggestion or you just want to contact me, please send me an e-mail to info at miguelangeljulvez.com. I'll be glad to hear from you.

Contribution

This is an open source and free project. If you're going to use it in your websites, please, think about the future and make a donation to WWF. Be part of the solution.

Madrid

Jul 22, 2018 4:35:22 AM

19 ºC
11 km/h

Sunday
8 km/h
17ºC / 31ºC
Monday
1 km/h
18ºC / 34ºC
Tuesday
11 km/h
19ºC / 32ºC
Wednesday
9 km/h
18ºC / 33ºC
Thursday
5 km/h
19ºC / 34ºC
Friday
7 km/h
19ºC / 34ºC
Saturday
9 km/h
19ºC / 34ºC
Sunday
2 km/h
18ºC / 34ºC