
Ham::Reference::Solar - Get basic solar data from the web that's useful for Amateur Radio applications.

Version 0.02

use Ham::Reference::Solar;
my $solar = new Ham::Reference::Solar;
die $solar->error_message if $solar->is_error;
# access data with a hash reference
foreach (sort keys %{$solar->get_hashref})
{
print "$_ = $solar->{$_}\n";
}
# or access data with the get method
foreach (sort @{$solar->all_item_names})
{
print "$_ = ".$solar->get($_)."\n";
}

The Ham::Reference::Solar module makes use of WM7D's Solar Resource Page to "scrape" (parse) data and return it for your use.
Please note that this module depends on the current formatting of the web site, and if it changes, this module will no longer work until I have a chance to update it.

Usage : my $solar = Ham::Reference::Solar->new();
Function : creates a new Ham::Reference::Solar object
Returns : a Ham::Reference::Solar object
Args : a hash:
key required? value
------- --------- -----
timeout no an integer of seconds to wait for
the timeout of the web site
default = 10

Usage : my $sunspots = $solar->get( $data_item_name ); Function : gets a single item of solar data Returns : a Ham::Reference::Solar object Args : a single item from the list of data items below
Usage : $solar->set( $data_item_name, $new_value );
Function : gets a single item of solar data
Returns : n/a
Args : data-item: see the list of data items below
data-value: any value with which you'd like to override the actual value
Usage : my $hashref = $solar->get_hashref();
Function : get all current solar data
(this is probably the easiest way to access data)
Returns : a hash reference
Args : n/a
Usage : my $arrayref = $solar->all_item_names();
Function : get an array reference of all solar data items available
from the object
Returns : an array reference
Args : n/a
Usage : if ( $solar->is_error() ) Function : test for an error if one was returned from the call to the web site Returns : a string, the error message Args : n/a
Usage : my $err_msg = $solar->error_message(); Function : if there was an error message when trying to call the site, this is it Returns : a string, the error message Args : n/a

The following items are available from the object. Use them with the get() method or access them with the get_hashref() method.
Solar flux index.
The A-index number.
The text interpretation of the A-index.
The K-index number.
The text interpretation of the K-index.
Brief text forecast for the next 24 hours
Bried text summary for the past 24 hours.
Current sunspot count.
URL for the current solar image from the Solar and Heliosphereic Observatory.
URL for the current thumbnail sized solar image from the Solar and Heliosphereic Observatory.
Time of the last update.


This module gets its data from WM7D's Solar Resource Page at http://www.wm7d.net/hamradio/solar. Thanks to Mark A. Downing!

Brad McConahay N8QQ <brad@n8qq.com>

Copyright 2008 Brad McConahay N8QQ, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.