5 Day Weather

Weather widget


This is a cool weather widget that you can insert in your website or blog. The widget can detect the visitor location and show the weather of the visitor city, automatically. As an alternative you can set it to always show the weather of one city chosen by you.

In the following preview the geographic location is automatically detected.

With map:


The code:

It's very easy to get it, you just have to copy the code and paste it in your site or blog.


No map:

It is possible to get the widget without a map. This is done by the parameter &map=false. The url on the code becomes src="https://5dayweather.org/widget.php?&map=false". Here is a preview:

Without map:


The code:

Set a City

You can set a specific city by adding a parameter to the URL inside the code. For example if you want the widget to always show the weather of Paris you will have to add &city=Paris . The URL would be src="https://5dayweather.org/widget.php?&city=Paris" . Now the widget will always show the weather for Paris no matter where the visitor actually is:


Set Temperature

You can choose to display temperature in Fahrenheit or in Celsius. It is set to Celsius by default. If you want it to show Farheneit degrees add the parameter &f=f to the URL. The result will be something like https://5dayweather.org/widget.php?&f=f . If you have already set the parameter of a city, then the URL should be something like src="https://5dayweather.org/widget.php?city=Paris&f=f". The visitor can always change the temperature by clicking in the link that is next to the value inside the widget.


Set Wind velocity

By default the velocity of the wind is shown in kilometers per hour (km/h). To set it to miles per hour (mph) add the parameter &w=mph to the URL. The result will be something like src="https://5dayweather.org/widget.php?&w=mph" . If you have already set the parameter of a city and the parameter of temperature, then the URL should be something like src="https://5dayweather.org/widget.php?city=Paris&f=f&w=mph". The units are what you have set but the visitor can always change the wind velocity by clicking in the link that is next to it inside the widget.


Set a different language

By default the titles are shown in english, but you can translate it easily to any language. This is done by adding to the iframe URL parameters for the three titles, "Today", "Humidity" and "Wind". For instance to translate the word "Today" to russian just add &today=Cегодня to the URL. In the same way you would add &humidity=Bлажность and &wind=Bетер to translate the other titles of the widget to russian.

The name of the city is by default presented in english but you can also change it to any other language. To do that you will have to know the exact code of the language you would like to set. You can get the language codes from this code list (the code you are interested in is the code shown in the first column, it's the "Language Culture Name"). For example for russian the code is "ru-RU". This code is inserted in the URL by adding the attribute &citylang=ru-RU.

To get the right translation of "km/h" (the units of wind velocity) use another parameter in the URL. For instance "km/h" in Russian is "км/ч". So you need to add the parameter &kmh=км/ч to the URL and the "km/h" will be correctly displayed in Russian.

After adding all the language parameters the URL would be something like src="https://5dayweather.org/widget.php?&today=Cегодня&humidity=Bлажность&wind=Bетер&citylang=ru-RU&kmh=км/ч". And so you would have your widget suitable for russian visitors.

Widget translated to Russian:


Note that not only the titles are translated but the name of the city is no longer "London" but it is now presented in the russian version "Лондон". The same could be done for any other language.