1 # contest.pl - contest calendar from www.sk3bg.se/contest
2 # used with 1 argument: sh/contest <yearandmonth>
3 # e g sh/contest 2002sep
4 # Tommy Johansson (SM3OSM) 2002-07-23
6 # New version use AsyncMsg (c) Dirk Koopman G1TLH
11 my ($self, $line) = @_;
13 return (1, $self->msg('e24')) unless $Internet::allow;
20 # trying to make the syntax abit more user friendly...
21 # and yes, I have been here and it *is* all my fault (dirk)
24 ($y) = $line =~ /(\d+)/;
25 ($m) = $line =~ /([a-z]{3})/;
33 $m = lc $DXUtil::month[$m];
35 $y += 2000 if $y <= 50;
36 $y += 1900 if $y > 50 && $y <= 99;
37 $m = substr $m, 0, 3 if length $m > 3;
38 $m = 'oct' if $m eq 'okt';
39 $m = 'may' if $m eq 'mai' || $m eq 'maj';
42 dbg("sh/contest: month=$mon") if isdbg('contest');
44 my $filename = "c" . $mon . ".txt";
45 my $host = $Internet::contest_host || 'www.sk3bg.se';
48 dbg("sh/contest: host=$host:$port") if isdbg('contest');
50 my $url = $Internet::contest_url || "/contest/text";
53 dbg("sh/contest: url=$url") if isdbg("contest");
55 my $r = AsyncMsg->get($self->call, $host, $url, prefix=>'ctst> ');
57 push @out, $self->msg('m21', "show/contest");
60 push @out, $self->msg('e18','sk3bg.se');