HAMweather 3 - US Threat Advisory Version 1.0 Plug-in 

Contents:

Overview

The threat advisory plug-in pulls the current advisory status form the Department of Homeland Security. They offer a web service for obtaining the current alert level.

Requirements:

The Threat Advisory plug-in has the same requirements as the core distribution.

Downloading:

You can download the US Threat Advisory plug-in from the HAMweather Plug-ins area at:
http://www.hamweather.net/hw3/hw3plugins?search=USThreatAdvisory

Installation:

    Installation of the threat advisory plug-in is fairly simple per the following steps:

Step Description
1 Confirm that HAMweather 3.02 or newer is installed and working correctly. 
 
2 Decompressing the Distribution:

The first step is to download the "zip" distribution of HW3image from the HAMweather Download Site and decompress the software package.  You can use  Winzip or something similar. Once unzipped you should have three directories and the files "readme.txt" and "license.txt".
 

4

Upload the Files:

The Installation requires the uploading of files to your server, specifically to the corresponding script side directories of the HW3 installation.  You will need to upload the following files to your current HW3 installation:

  1. Upload the "FetchUSThreatAdvisory.pm" (PHP Users: FetchUSThreatAdvisory.php) file to the hamlib/HW3Plugins directory.

    NOTE: Your FTP program may not auto recognize ".pm" or ".php" files as text files and may try to upload in binary mode. You should force your FTP program to upload these files in ASCII mode as uploading in binary mode will cause errors on UNIX/LINUX servers.

    The following should be installed in the paths indicated after you upload the file:

    PERL / ASP:
         hamlib/HW3Plugins/FetchUSThreatAdvisory.pm

    PHP:
     
        hamlib/HW3Plugins/FetchUSThreatAdvisory.pm
  2. Upload the fc_usthreatadvisory.ini (PHP Users: fc_usthreatadvisory.ini.php)  with-in the distribution's "configs" directory to the "configs" directory of the HAMweather 3 installation. 
    NOTE: Your FTP program may not auto recognize ".ini" files as text files and may try to upload in binary mode. You should force your FTP program to upload these files in ASCII mode as uploading in binary mode will cause errors on UNIX/LINUX servers.

    The following should be installed in the paths indicated after you upload the in the distributions "templates" directory:

         configs/fc_sevmap.ini
    PERL / ASP:
         configs/fc_sevmap.ini

    PHP:
     
        configs/fc_sevmap.ini.php
     
  3. Upload the usthreatadvisory.html file with-in the distribution's "/templates" directory to the "templates" directory of the HAMweather 3 installation. NOTE: You are not replacing your current "templates" directory but simply uploading the template files to the "templates" directory on the server.

    The following should be installed in the paths indicated after you upload the in the distributions "templates" directory:

         templates/usthreatadvisory.html
     

Accessing:

There are two main ways to use the US Threat Advisory plug-in. The first is to call the HW3 script file telling it to fetch the advisory and display it using the default template.

PERL:
    hw3.cgi?forecast=usthreatadvisory

ASP:
    hw3.asp?forecast=usthreatadvisory

PHP:
    hw3.php?forecast=usthreatadvisory

With the above method you can edit the usthreatadvisory.html template to change the display you like.

The second way to use this plug-in is to call it with in a template. For instance if you want to add the current US Threat advisory to your main forecast page you could edit the zandh.html template and put the following in it:

%%FORECAST forecast=usthreatadvisory FORECAST%%

After the above line you could then use the plug-ins template variables (such as %%threat_advisory_level%%) to output the current advisory.

 

Parameters:

This plug-in has no additional parameters which can be passed to it besides the default HAMweather parameters.

Template Variables:

The threat advisory plug-in offers the following template variables:

Template
Variable
Description
%%threat_advisory_level%% The current advisory level text: LOW, GUARDED, ELEVATED, HIGH, SEVERE
%%threat_advisory_color%% The corresponding advisory levels color text name: Green, Blue, Yellow, Orange, Red
%%threat_advisory_color_hex%% The corresponding advisory levels color in hex format. This is useful in HW3image or when setting a color in html.

INI Configuration:

The threat advisory plug-in is pre-configured upon installation and should work with out error.  But does include the following configuration settings in the fc_usthreatadvisory.ini (PHP users: fc_usthreatadvisory.ini.php) file:

INI Line Description
[ForecastTypes]  Begin the ForecastTypes section: This is the section where the information on HW3 should use the plug-in is stored.
usthreatadvisory=... The Plug-in information line. See the HW3 Standard plug-in docs for more info. NOTE: that the "15" in this line corresponds with the max cache age in minutes. HW3 will fetch the current level and then cache it for the 15 minutes before re-fetching. This helps speed the plug-in and save bandwidth. Though when the level does change this means your site could take up to 15 minutes to change to the new value. 
 
[URLs] Begin the URLs section: This is the section where the information on the URLs HW3 should use to fetch the ASUS data is stored.
usthreatadvisory_url=www.dhs.gov The domain name. 
usthreatadvisory_prefix=/dhspublic/getAdvisoryCondition The path to the data on the domain indicated by the usthreatadvisory_url

Support

You can find support for this plug-in via the online support forums, specifically the HW3plug-ins forum:

History/Changes