kksou Google Weather Module - AJAX version
Written by kksou   
Sunday, 04 October 2009
download button
faq button

This module makes use of the Google Weather API to display the current temperature, weather condition and a four-day weather forecast, as you can see on the left of the page.


Unique Features

This is the first, and currently the only weather module with the following features:

  • Uses the Google Weather API that provides 4-day weather forecast with images.
  • Allows user to interactively enter zip codes (for US, UK and Canada) and city names.
  • Displays the weather information in many different languages, as provided by Google.
  • Allows you to display two or more weather modules in the same page.
  • Supports both Joomla 1.0 and Joomla 1.5!
  • You can turn on or off the input field.
  • You can specify the default unit for the temperature (in °C or °F)
  • You can switch between °C or °F interactively with no reloading of pages.
  • You can choose to display wind speed in mph or km/h
  • Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x, 1.7.x and 2.5.x!
Latest Version

v1.07 (for Joomla 1.0) and v1.57 (for Joomla 1.5), v1.67 (for Joomla 1.6), v1.77 (for Joomla 1.7), v2.5.7 (for Joomla 2.5)
Released January 26, 2012

Native version of the Google Weather Module for Joomla 2.5!

Very Important

  • I've implemented the Google Weather Mashup with the use of PHP's cURL library. So please make sure your PHP has the cURL library installed in order to use this module.
  • Note that this module works only with PHP5 and above because of the use of the PHP function simplexml_load_string which is only available starting with PHP5.

Live Demo

You can see some live demos below:

Download


Remove the "Powered by" links

If you find the module useful and would like to use the module without the "Powered-by" links, you may do so by purchasing a "Powered-by" removal license for only USD $10 per site.

Secured payment is processed by 2checkout.com. All major credit cards are accepted, including Visa, Mastercard and American Express, etc. You can also pay by PayPal. Once the transaction is completed, you will be given a link to download the registered version with the "Powered by" links removed.

How to install

  1. First, make sure you're using PHP5 and above.
  2. Then, make sure your PHP has the cURL library installed. You can do a quick check by doing a simple
  3. <?php
    phpinfo();
    ?>
    

    If your PHP has the cURL library installed, you should see something similar to the following:

    phpinfo.gif

    If you don't have the cURL library, there are numerous resources on the Internet that gives you very clear instructions on how to install cURL on various platform such as windows, linux, etc.

  4. Download and install the "kksou Google Weather Module".
  5. Make sure the module is published / enabled.
  6. Select a module position where you want to place the module.

That's it! You should now see the kksou Google Weather module displayed in the module position you've specified.

Parameters

You can set the following in the Parameters page:

  1. Default City: This is the city that will be displayed when the module is first loaded. For large cities, you can just enter the city name e.g. San Francisco, London, Tokyo, Moscow, without the need to enter the country name.
  2. For some countries (e.g. US, UK and Canada), you can just enter the zip code. E.g. '94305', 'W1A 1AZ'.


  3. Language: Google supported language code in ISO 639-1 format
    e.g. English is en, French is fr, Italian is it, Japanese is ja, Chinese simplified is zh-cn, Chinese Traditional is zh-tw.
  4. Unit for temperature: Choose between displaying the temperature in °F or °C.
  5. Hide Input Field: If all you want is to display the weather forecast of a particular city, and DO NOT want the user to change that, you can select 'Yes' to hide the input field.
  6. Hide Humidity: Select 'Yes' if you wish to hide the humidity information.
  7. Hide Wind: Select 'Yes' if you wish to hide the wind information.
  8. Hide Forecast: Select 'Yes' if you wish to hide the 4-day weather forecast.
  9. Label for 'City': This is the label that is displayed just before the input field. The default label is 'City'. You can change the label into your own language and label.
  10. Size of Input Field: Size of the input field. Default size is 12.
  11. Request Interval: If you do some research on google, you will see that there arer cases where Google will "ban" your site from accessing the Google Weather API if the request is made too often (e.g. some sites try to get the weather forecast of all cities in US through a robot). By default, I set a interval 3 seconds between each request to Google. This will prevent your users from making too frequent weather forecast requests via your website. If you are not concerned about this, you can reduce this to 1 second.
  12. Set Focus on Input Field: Set the focus (i.e. put the prompt) on the input field for city. Default is Yes.

Styling the Module using CSS

The entire formatting of the stock quotes is done using CSS. If you do not like the default look and feel of the stock data, you can edit the following CSS file:

<your joomla root folder>/modules/mod_kksouGoogleWeather/mod_googleWeather.css

  1. Input Field (for entering city name)
  2. div.googleWeather input {
    	margin-bottom: 6px;
    }
    
  3. Input Label (the label 'City')
  4. div.googleWeather .input_label {
    	font-weight:bold;
    }
    
  5. The current temepature
  6. div.googleWeather .deg {
        font-size: 100%;
    	color: #3366FF;
    	font-weight:bold;
    }
    
  7. The image of the current weather condition
  8. div.googleWeather .img2 {
    	float: right;
    }
    
  9. The current weather condition
  10. div.googleWeather .cond {
    	font-size: 100%;
    }
    
  11. The current wind condition
  12. div.googleWeather .wind {
        font-size: 100%;
    }
    

History

  1. v1.0.1 (for Joomla 1.0) and v1.5.1 (for Joomla 1.5)
    Released October 6, 2009
  2. Streamlined the javascript codes.

  3. v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
    Released January 20, 2010
  4. v1.0.3 (for Joomla 1.0) and v1.5.3 (for Joomla 1.5)
    Released February 14, 2010
  5. This is in response to the request by Mazgonar.

    Added one more parameter in the config page to allow user to choose whether to set focus on the input field for the city.

  6. v1.0.4 (for Joomla 1.0) and v1.5.4 (for Joomla 1.5)
    Released May 06, 2010
  7. Conform to joomla.org guidelines.

  8. v1.0.5 (for Joomla 1.0) and v1.5.5 (for Joomla 1.5)
    Released May 16, 2010
  9. The module is now W3C XHTML 1.0 Transitional compliant.

  10. v1.6.6 (for Joomla 1.6) and v1.7.7 (for Joomla 1.7)
    Released October 10, 2011
  11. Native version of the Google Weather Module for Joomla 1.6 and 1.7!

  12. v1.6.7 (for Joomla 1.6) and v1.7.7 (for Joomla 1.7)
    Released October 16, 2011
  13. Support for km/h for wind speed. If you display the temperature in degree Celsius, the wind speed will be displayed in km/h. If you display the temperature in degree Fahrenheit, the wind speed will be displayed in mph.

    Note: By default, Google only returns the wind speed information in mph. I used the PHP function preg_match() to search for the string "mph". If you have displayed the weather information in other languages (e.g. Russian) which does not display miles per hour as "mph", the module will just display whatever wind information that is returned by Google.


 

Comments  

 
# Sean Lee 2012-01-23 10:05
Thanks
Reply | Reply with quote | Quote
 
 
# Scott Alexander 2012-01-28 20:02
This is what I am searching for. I would really like to know if Google has a weather module. I'm glad that it has.
Reply | Reply with quote | Quote
 
 
# Czech Cricket 2012-03-08 04:38
Thank you, the module was very easy to set up on our website and provides a very useful service. No problems at all so far!

I wanted to leave a nice review for you on the JED but your link there is down, it says the link to downloading this module is broken. Hope you get that fixed soon - you deserve the product to be used more.

Thank you again
Reply | Reply with quote | Quote
 
 
# kksou 2012-03-09 07:14
Hi,

Thanks a lot for informing me about this. Appreciate this greatly.

Have updated the demo link and informed Joomla.org. Guess it will take them a couple of days for review and reactive the page.

Thanks once again!

Warm Regards,
/kksou
Reply | Reply with quote | Quote
 
 
# dora 2012-03-15 15:22
I've downloaded the module(2.5, all is good on that end. Where do I fine the CSS info to make changes in the font?
thanks
Reply | Reply with quote | Quote
 
 
# kksou 2012-03-15 17:49
Hi,

The css file is in the folder: [Joomla_root_fo lder]/modules/mod_kksouGoogle Weather

css file: mod_kksouGoogle Weather.css

Please note that most browsers cache the css style sheets. So after editing and saving the css file, remember to clear the browser cache.

The best way I find is to point your browser to your css file and load the css file in the browser. You can see very clearly if the browser is still using the old cached version or your latest edited version. (Just keep hitting refresh until the browser reloads the fresh copy.)

Let me know if it works, ok?

Regards,
/kksou
Reply | Reply with quote | Quote
 
 
# Gerardo Bredfeldt 2012-05-09 16:43
Hi, I migrate my page from Fatcow to Arvixe and your module stop working. It searches endless for the city. Arvixe has support for Php4 and 5. CURl is enabled. My Joomla is 1.5.25 and I'd install "mod_kksouGoogle Weather_v1.57.zip". Tryed twice, no success. Installed a few other free weather modules ---> ok, but I would prefer yours. Thanks for possible help.
Reply | Reply with quote | Quote
 
 
# Toni Rauma 2012-05-11 05:35
Hi,
I have a problem with scandic letters (едц) with finnish language. The module displays them wrong and it becomes messy :/
Reply | Reply with quote | Quote
 
 
# kksou 2012-05-11 07:19
Hi Toni,

Are you referring to
1) the city input field, or
2) the weather result returned by Google?

You have an URL to show the actual output?

Regards,
/kksou
Reply | Reply with quote | Quote
 
 
# Toni Rauma 2012-05-13 23:23
I think it's a server related problem cause it seems to work on this demo site. Any suggestions how to get rid of it? :-?

Here's an URL: http://www.sivutuote.com/sivut/metsa/
Reply | Reply with quote | Quote
 
 
# kksou 2012-05-13 23:52
Hi Toni,

Just went to your site. Did a view source. Think the only difference between your page and my page (kksou.com) is in your header, in which yours is lang="fi-fi".

Can you try setting the lang to other settings, such as utf-8? This will allow you to see if it's the problem with the language setting.

Interesting, I did a view source for some Finnish language websites e.g.
http://www.gps-waypoints.net/gps/?language=fi
http://www.infopankki.fi/en-gb/finnish_language/

Both did not have the setting lang="fi-fi".

Instead, one has:
content="text/html;charset=ISO-8859-1"
The other has: content="text/html;charset=UTF-8"

So would suggest you do some testing with the content and lang settings and see if your web pages display correctly, and the weather information returned by google also displayed correctly.

Regards,
/kksou
Reply | Reply with quote | Quote
 
 
# kksou 2012-05-13 23:57
Hi Toni ,

By the way, just for your info, while the google weather information can be in many different languages, Google only allows you to enter the city name in English. Yes, English only.

It's Google. They set the rule. So there's nothing much we can do about this...

Regards,
/kksou
Reply | Reply with quote | Quote
 
 
# broken link 2012-05-13 13:57
Joomla 1.5.x: mod_kksouGoogle Weather_v1.57.zip
broken link. doesnt end.
Reply | Reply with quote | Quote
 
 
# kksou 2012-05-13 17:48
Hi,

Just tested the download link. It works fine.

For your convenience, have emailed a copy of the module to you.

Regards,
/kksou
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh

< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2012. kksou.com. All Rights Reserved