From: Mischa POSLAWSKY Date: Mon, 13 May 2019 21:20:29 +0000 (+0200) Subject: ignore missing clan restriction; fallback to user name X-Git-Tag: v0.4~7 X-Git-Url: http://git.shiar.nl/sc2-widget/commitdiff_plain/73d1bf9607b8ca88878e89b53eb00fa89135bcc0 ignore missing clan restriction; fallback to user name --- diff --git a/getsc2clan b/getsc2clan index 3285535..9e6222a 100755 --- a/getsc2clan +++ b/getsc2clan @@ -16,7 +16,7 @@ if (@ARGV and all { m[/] } @ARGV) { my ($profiles, $clanmatches) = part { /\D/ } @ARGV; # separate numbers $profiles && @{$profiles} or die "Usage: $0 ... [...]\n"; -my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches}; +my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches || []}; sub blizget { state $bliz = do { diff --git a/widget.html b/widget.html index 64f35a2..d6f5f8d 100644 --- a/widget.html +++ b/widget.html @@ -25,7 +25,7 @@ .then(clan => { let tiernum = (rank) => rank <= 8 ? 1 : rank <= 25 ? 2 : rank <= 50 ? 3 : 4; document.getElementById('clan').outerHTML = ` -

${clan.tag}

+

${clan.tag || clan.members[0].name}

    ${clan.ladders.map(ladder => `