git.shiar.nl
/
sc2-widget
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
html headers before wrapper errors
[sc2-widget]
/
getsc2clan
diff --git
a/getsc2clan
b/getsc2clan
index b1a5ebdcc25085ad749d13b0ba9acbdd2a5ee048..9e6222ac74e5690457212ad0190095c567d79e7c 100755
(executable)
--- a/
getsc2clan
+++ b/
getsc2clan
@@
-8,10
+8,15
@@
use LWP::Authen::OAuth2;
use JSON qw( decode_json );
use List::MoreUtils qw( all part nsort_by );
use JSON qw( decode_json );
use List::MoreUtils qw( all part nsort_by );
+if (@ARGV and all { m[/] } @ARGV) {
+ say pp blizget($_) for @ARGV;
+ exit;
+}
+
my ($profiles, $clanmatches) = part { /\D/ } @ARGV; # separate numbers
my ($profiles, $clanmatches) = part { /\D/ } @ARGV; # separate numbers
-@{$profiles}
+
$profiles &&
@{$profiles}
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 ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches
|| []
};
sub blizget {
state $bliz = do {
sub blizget {
state $bliz = do {