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).
- 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.
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:
<$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
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.
- 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.
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">
Replace ‘Burlington, VT’ with the name of your city and country. See Wundergound.com for location.
the template and go rebuilding to refresh the page. Finished.
Demo: The current weather for Palembang on the side menu of the main page.