#-*-Perl-*-

#Tack on the names of the subroutines to the list of functions
$hof{"downearth"} = 0;

#Down to Earth 
# http://www.downtoearth.ncbuy.com/
#not date based
sub downearth  {
  my $time = shift;
  my @ltime = gmtime($time);
  my $date = strftime("%Y%m%d",@ltime);
  my @ltime2 = gmtime(time);
  my $daysago = (time - $time)/(3600*24);
  $daysago =~ s/\..*$//;

  my $baseurl = "http://downtoearth.ncbuy.com";
  my $rec = {
    'title' => "Down To Earth",
    'author' => "Gavin Chafin & Steve Wood",
    'type' => 'gif',
    'main' => $baseurl,
    'archives' => $baseurl."/archives/",
    'base' => "$baseurl",
    'size' => [580,196],
    'page' => "/archives/index.html",
    'func' => sub{
       my $text = shift;
       my @relurls = ();
       if ($text =~ s/img src="\/img\/partners\/downtoearth\/strips\/(\d+?)_72dpi.gif"//i) {
         push @relurls, {
           'page' => "/archives/index.html?strip=".($1-$daysago),
           'exprs' => ["img src=\"(/img/partners/downtoearth/strips/\\d+?_72dpi.gif)\""],
           'func' => undef,
         };
       }
       return @relurls;
    },
  };
  return $rec;
}

1;

