HAMweather 3 - RSS Plug-in 1.0

Contents:

Overview:

The HW3 RSS plug-in is the plug-in that allows HW3 to parse and display various RSS 2.0 feeds.

License:

The HW3convert plug-in falls under the HAMweather 3 Software suite license. You can find the latest version at:
http://www.hamweather.net/hw3/docs/license.html

Requirements:

The RSS plug-in requires that HW3 have been previously installed and is working correctly..

Installation:

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

Step Description
1 Confirm that HAMweather 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 directory,  "configs", "hamlib", "templates"  and the files "readme.txt" and "license.txt".
 

3

Upload the Files:

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

  1. Upload the "FetchRSS.pm" (FetchRSS.php in 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:

         hamlib/HW3Plugins/FetchRSS.pm (hamlib/HW3Plugins/FetchRSS.php in PHP)


     
  2. Upload the "RSS.pm" (RSS.php in PHP) file to the hamlib/HW4 directory. Note that you may need to create the "HW4" subdirectory with in the "hamlib" 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:

         hamlib/HW4/RSS.pm (hamlib/HW4/RSS.php in PHP)

     
     

  3. Upload the files with-in the distribution's "configs" directory to the "configs" directory of the HAMweather 3 installation. NOTE: You are not replacing your current "configs" directory but simply uploading the ini files to the "ini" directory on the server.

    NOTE: Your FTP program may not auto recognize ".ini" or ".ini.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 in the distributions "templates" directory:

         configs/fc_msnwxnews.ini (configs/fc_msnwxnews.ini.php in PHP)
         configs/fc_topixwxnews.ini (configs/fc_topixwxnews.ini.php in PHP)
         configs/fc_yahoolocalnews.ini (configs/fc_yahoolocalnews.ini.php in PHP)

     
  4. Upload the files 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/rss.html
     

 

Accessing:

For instructions on accessing and using HW3 review the HW3 access instructions.  To access the different RSS feed you will need to set the 'forecast' or 'do' parameter to one of the following:

Parameter 
Setting
Description
forecast=msnwxnews Used to dispaly the RSS Feed Weather News from MSN
forecast=topixwxnews Used to dispaly the RSS Feed Weather News from Topix
forecast=yahoolocalnews&place=<place>&state=<state> Used to dispaly the RSS Feed Local News from Yahoo

To access the rss plug-in and have it display the contents of the RSS Feed  you will access a url similar to:

    hw3.cgi?forecast=msnwxnews
    hw3.cgi?forecast=topicwxnews
    hw3.cgi?forecast=
yahoolocalnews&place=Atlanta&state=GA
 

Accessing Other RSS Feeds:

You will most likely want to use the RSS plugin to fetch other data besides just the Weather News from MSN and Topix and Yahoo's Local News. When you use the RSS plug-in you will need to create one file, an INI file thats holds the configuration information. 

The first thing you will need to do is find the URL to the RSS Feed that you want to display in HAMweather. Once you have this you can begin creating the INI file.

NOTE: You must verify with the RSS source if the data may be used on their site as some RSS providers only allow using their feeds on non commercial sites.
 

The INI file:

The INI file should be saved into the "configs" directory with a name similar to fc_xxxx,ini (fc_xxxx.ini.php  in HW3php), where "xxxx" is the same as the value you will pass in the "forecast" parameter. For example: to access the Weather News from MSN, we decided to use "forecast=msnwxnews", thus the INI file must be saved as "fc_msnwxnews.ini" (fc_msnwxnews.ini.php in HW3php)..

Once the naming of the new INI file is complete you will need to add the various required settings to it for use in grabbing your RSS Feed. The following is the INI file from the fc_msnwxnews.ini.Comments have been added above the various settings to provide additional information.


[URLs]
;rss_url should be set tot he domain of the server
;containg the data you need

rss_url=rss.msnbc.msn.com

;rss_prefix should be set to the path on the domain where
;the needed data is located. Note that the plugin will allow
;you to use simple "INI" variables. Parameters passed in the 
;query string (or form post), the cache_path or data obtained from
;looking up information on a location. In close the variable name with
;"%%" as in "%%state%%". You can also prepend the variable name with 
;"lc_" to turn the result to lowercase or "uc_" for uppercase.

rss_prefix=/id/3032127/device/rss/rss.xml

;rss_cache_file should be set to the path to cache the data
rss_cache_file=%%cache_path%%/msnwxnews.rss

[ForecastTypes]
# type = IWIN/URL, max age, template,parse code
; Set the beginning portion the "type" to the value you will pass in the 
;"forecast" parameter. The right side of the equal sign is:
;    IWIN/URL : no longer used
;   Max Age : used to control the max age in to cache the data for
;   template : the template to use when outputting the data
;   Plugin Module : Set to "FetchRSS"
;   Plugin routine name : set to "fetch_rss"
;   ParseCode : Normally 0 for this plugin, set it to 1 if you want 
;                       HW3 to obtain information on a location before 
;                       fetching the data

msnwxnews=notused,60,rss.html,FetchRSS,fetch_rss,0
 



Parameters:

Here is a complete list of all the parameters that can be passed to the HW3 RSS plugin via the query string or form post:

Parameters that can be used for displaying the Yahoo Local News

Parameter Description
place (Required for Yahoo Local News) Specifies the place that the data is needed for. If you do not specify this parameter then "Default Place and State" is assumed.
state

(Required for Yahoo Local News) Specifies the state that the data is needed for. If you do not specify this parameter then "Default Place and State" is assumed.

 

Template Variables:

The RSS plug-in offers the following template variables:
 

Common Template Variables
Template
Variable
Description
%%rss_items_total%% Total Number of RSS Entries.
%%url_rss_link%% Displays the URL Link.of the Provider.
%%rss_title%% Displays the Title of the Provider.
%%url_rss_item#_vvlink%% Displays the Link of the RSS Item.
%%rss_item#_vvtitle%% Displays the Title of the RSS Item.
%%rss_item_#vvdescription%% Displays the Description of the RSS Item.
%%rss_item#_vvpubDate%% Displays the Published Date.
%%rss_item#_vvsource%% Displays the Source of the RSS Item.

RSS Format:

All other rss 2.0 elements not mention can be added via following the path to the element:


<item>
  <title>Star City</title>
  <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
  <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>.</description>
  <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
  <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
</item>
 

Support

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

History/Changes