use JSON qw( decode_json );
use List::Util qw( all );
-my ($profileid, $clanmatch) = @ARGV; # clan host and name
+my ($profileid, @clanmatches) = @ARGV; # clan host and names
$profileid and $profileid =~ /\A\d+\z/
- or die "Usage: $0 <profile id> [<clan name>]\n";
+ or die "Usage: $0 <profile id> [<clan name>...]\n";
+my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @clanmatches;
my %auth = do './.blizzard.passwd.pl' or die "no auth setup: $!\n";
my $bliz = LWP::Authen::OAuth2->new(%auth,
} # activity desc
grep {
!$clanmatch or
- all { fc $_->{clanName} eq fc $clanmatch } $_->{characters}->@*
+ all { $_->{clanName} =~ $clanmatch } $_->{characters}->@*
} # members
grep { $_->{ladder}->[0]->{division} }
$ladderdata->{currentSeason}->@*