Working with MT Part 3

This is the third part of the Working with MT articles which are written to document any activities I did on my weblog. On this part, I will tell you how to work with two weather plug-ins that are available for MovableType and also already installed here on my site (just look at the side menu under “Current Weather” section).

  1. WeatherNWS, developed by Ashley. This plug-in will display weather based on METAR stations around the country. You can download it on Ashley’s website.

    Installation:

    As this plug-in needs another third party perl module in order to work properly, I went to the website of CPAN and downloaded this module, Geo::WeatherNWS. After unpackaging the file, I uploaded the file into the ‘Geo’ directory which is a new directory you have to make inside the existing ‘extlib’ directory in your main MT directory. And then, not to forget, I also uploaded the ‘weathernws.pl’ file I got from Ashley’s website into the ‘plugins’ directory. If the directory doesn’t exist yet, you need to create one. Done with uploading the files. Now, just go to the weblog’s templates and add the following tags on the page or place where you want it appears:

    <MTWeatherNWS place="ehrd">
    <$MTWeatherConditionstext$>: <$MTWeatherTemperature_c$>°C / <$MTWeatherTemperature_f$>°F<br
    />
    Cloud Cover: <$MTWeatherCloudcover$><br />
    Wind: <$MTWeatherWinddirtext$> <$MTWeatherWinddir$>° at <$MTWeatherWindspeedkph$>
    kph (<$MTWeatherWindspeedmph$> mph)<br />
    Humidity: <$MTWeatherRelative_humidity$>%<br />
    Visibility: <$MTWeatherVisibility_km$> km / <$MTWeatherVisibility_mi$> mi.<br />
    Barometric: <$MTWeatherVisibility_mi$> kPa / <$MTWeatherPressure_mb$> mb
    </MTWeatherNWS>

    Yes, they are the tags I used here. For complete tags, please consult this page on Ashley’s site.

    In order to display the right weather for your city, replace ‘ehrd’ METAR code right after ‘place’ on <MTWeatherNWS> tag to the METAR code of your city. This page on National Weather Service’s website will help you to find the METAR code for almost any country and city in the world.

    To conclude all things we’ve done, save the template and then rebuild it to refresh the page.

    Demo: The current weather for Rotterdam and Jakarta on the side menu of the main page.

  2. WeatherUnderground, developed by Gavin Estey. This small plug-in will display the weather of a specified city from Wunderground.com. Get the latest version of this plug-in here.

    Installation:

    Just like WeatherNWS, WeatherUnderground also needs another third party perl module, called Weather::Underground to get working. After downloading all packages, upload the mt-weatherunderground.pl file into the ‘plugins’ directory and the underground.pm file into a new directory ‘Weather’ inside the ‘extlib’ directory. Done with uploading, it’s time to add the tags into your template(s). Use the following tags:

    <MTWeatherUnderground place="Burlington, VT">
     <$MTWeatherUConditions$>: <$MTWeatherUFahrenheit$>°F
      (<$MTWeatherUCelsius$>°C)
    </MTWeatherUnderground>

    Replace ‘Burlington, VT’ with the name of your city and country. See Wundergound.com for location.

    Save
    the template and go rebuilding to refresh the page. Finished.

    Demo: The current weather for Palembang on the side menu of the main page.

Advertisement

5 Comments

  1. I tried the WeatherNWS, I have followed your instructions, but when rebuilding, I got this error: MT::App::CMS=HASH(0x8069de0) Use of uninitialized value in string at extlib/Geo/WeatherNWS.pm line 455.

    I use the METAR “wiij” (Yogyakarta)..

    Any idea about this? About uploading process.. or… ?

    Thanks!

  2. Thomas,

    All files should be uploaded in ASCII mode. If you’ve already done so and then, the weather for your city shows up on the page after rebuilding, it means everything is ok. What about the error message you got? I think, it is coming from the value used by the Geo:WeatherNWS script that is not recognized by MT as a valid value. FYI, I also got the same message for WeatherUnderground. But, when I noticed everything seemed alright after rebuilding, I just ignore it. I hope this information will be clear enough for you.

  3. I tried the WeatherUnderground. I have followed your instructions

    When rebuilding there is no error occured
    but on my Blog page,it just display :°F(°C)

    It seems to that the plugin does not work
    My other plugins(MTPaginate…) have the same situation. 😦

    Any idea about this? Thanks~

Comments are closed.