git.shiar.nl
/
sc2-widget
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f514022
)
ignore missing clan restriction; fallback to user name
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 13 May 2019 21:20:29 +0000
(23:20 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 13 May 2019 21:20:29 +0000
(23:20 +0200)
getsc2clan
patch
|
blob
|
history
widget.html
patch
|
blob
|
history
diff --git
a/getsc2clan
b/getsc2clan
index 328553523d7b6834281c05b2a5a26afa0c3fa49b..9e6222ac74e5690457212ad0190095c567d79e7c 100755
(executable)
--- 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 <profile id>... [<clan name>...]\n";
my ($profiles, $clanmatches) = part { /\D/ } @ARGV; # separate numbers
$profiles && @{$profiles}
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 {
diff --git
a/widget.html
b/widget.html
index 64f35a252f067397445d576128b16e10c74b478a..d6f5f8d66ddeef85b5e32b721724e4873d38e5b2 100644
(file)
--- 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 = `
.then(clan => {
let tiernum = (rank) => rank <= 8 ? 1 : rank <= 25 ? 2 : rank <= 50 ? 3 : 4;
document.getElementById('clan').outerHTML = `
- <h1>${clan.tag}</h1>
+ <h1>${clan.tag
|| clan.members[0].name
}</h1>
<ul class=ladders>
${clan.ladders.map(ladder => `
<li class="rank ${ladder.league} tier${tiernum(ladder.rank)}"
<ul class=ladders>
${clan.ladders.map(ladder => `
<li class="rank ${ladder.league} tier${tiernum(ladder.rank)}"