The World at Your Fingertips
    Published in Weather

    The TitiTudorancea.com
    Current Weather Widget

    Use this widget to show on your website or blog the current weather conditions for a certain place (or for several places). This script is accurate, powerful, fast, easy to implement and it works for about 6,000 places from all over the world. And it's 100% free!

    Have a look at the examples below and copy the code for the example that fits your website. If you need help setting this widget, read the Setup Parameters and the FAQ sections below.






    In the example above, the variable big was set to yes, and the icons and the text of the widget are larger.

    The variable fcstlink (forecast link) was set to yes; as a result, a green link appears below each place, giving your users access to the forecast for that place.

       



    In the example above, the variable big was set to no, and the widget displays the weather (for several places) using smaller text and icons. The variable fcstlink was set to no.


    The widget will auto-expand to fill all available horizontal space. If you intend to put the widget into a narrow column (say, with a width below 300px), the second example (the one on the right) might suit you best. On the other hand, if you have enough horizontal space, you might prefer the example on the left.

    In both examples above, the variable place was set to show current weather conditions for several places (the value of the variable is a list of place ids, delimited by dots). The example below (on the left) shows the weather for only one place. This time the variable fcstlink was set to no for the example on the left and to yes for the example on the right.



       




    Setup Parameters


    place (required)

    This is the most important parameter: its value must be the ID (a string) of the place you want to show the current conditions for. If you want to show the weather for several places, the value of the variable must be a list of place IDs, separated by dots. To get the ID of a place, go to the page with the current weather for that place, and then click the "GET THE CODE" button on the right column. When you click that button, all the widgets on this page are updated to use the ID of that place, and you may copy the ID of that place from the code for any example.

    If you did not visit the page with the current weather information for a place before coming here, type the name of a place in the search box on the right, and once you find it click the "GET THE CODE" button.


    big (optional)

    This is another important parameter. It controls the type of display: big (see the examples above, on the left) or small (examples of the right). Allowed values are yes and no (the default value is no).


    lang (optional)

    This parameter controls the language of the text displayed by the widget. Default value is en.


    temp (optional)

    You can modify this parameter to show Celsius temperatures (temp=c) or Fahrenheit temperatures (temp=f). If you omit this parameter, the default is c.

    Note: temperatures are shown in degrees Fahrenheit (temp=f) only if the language of the widget is English (lang=en), otherwise they are shown in degrees Celsius.


    speed (optional)

    Modify this parameter to show the wind speed in km/h (speed=k) instead of mph (speed=m. If you omit this parameter, the default is k.


    fcstlink (optional)

    If this is set to yes, below the current conditions for a place is put a green link to the weather forecast for that place. Allowed values are yes and no (the default value is yes).



    FAQ


    Can I change the colors/fonts/background color of the widget?

    Yes, to adapt the widget to the design of your website or blog, you may change the CSS definitions as you wish.

    For example, to change the font family, you may replace in the CSS definitions the text Verdana, Arial, Helvetica, sans-serif with Georgia, serif or any other font families you wish. You may also increase or decrease font sizes.


    Can I use two (or more) widgets on the same page?

    Yes, but you have to delete from the code of each widget the line <div id="w_div"></div>. Also, if all the widgets on your page have the same value for the variable big, then all of them are using the same CSS definitions and you may delete the CSS styles (ie. from <style> to </style>) of the second and subsequent widgets (leave only the CSS definitions of the first one).


    How often are the weather conditions updated?

    Weather conditions are based on observations delivered by weather stations (usually located at airports). Some stations are manned, others are automated. Some deliver four updates per hour, while other stations deliver only one update every two hours. That being said, most weather stations deliver about two to four updates per hour.


    How fast is this widget?

    Our current weather widget is very fast. It normally deliveres data to users' browsers in about 0.02 seconds.


    Can I move the CSS definitions in the HEAD portion of my web page, or in my external CSS file?

    Yes, this is a good idea, as some DOCTYPEs require CSS defintions to be placed in the HEAD of the html page, and it's never wrong to do so anyway.

    If you own or manage a travel-related business such as a hotel, a bed-and-breakfast, a restaurant, a pub or a cafeteria, you can create a web page for your business for free on Titi Tudorancea Travel Info. ยป

    © 1991-2024 Titi Tudorancea Travel Info | Titi Tudorancea® is a Registered Trademark | Terms of use and privacy policy
    Contact