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
5 # New version using Net::Telnet 2003-03-09
12 my ($self, $line) = @_;
14 return (1, $self->msg('e24')) unless $Internet::allow;
21 # trying to make the syntax abit more user friendly...
22 # and yes, I have been here and it *is* all my fault (dirk)
25 ($y) = $line =~ /(\d+)/;
26 ($m) = $line =~ /([a-z]{3})/;
34 $m = lc $DXUtil::month[$m];
36 $y += 2000 if $y <= 50;
37 $y += 1900 if $y > 50 && $y <= 99;
38 $m = substr $m, 0, 3 if length $m > 3;
39 $m = 'oct' if $m eq 'okt';
40 $m = 'may' if $m eq 'mai' || $m eq 'maj';
43 dbg("sh/contest: month=$mon") if isdbg('contest');
45 my $filename = "c" . $mon . ".txt";
46 my $host = $Internet::contest_host || 'www.sk3bg.se';
49 dbg("sh/contest: host=$host:$port") if isdbg('contest');
51 my $url = $Internet::contest_url || "/contest/text";
54 dbg("sh/contest: url=$url") if isdbg("contest");
56 my $r = AsyncMsg->get($self->call, $host, $port, $url, prefix=>'ctst> ');
58 push @out, $self->msg('m21', "show/contest");
61 push @out, $self->msg('e18','sk3bg.se');