simple page to parse and display inno.json include
[sc2-widget] / widget.html
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5 <meta charset="utf-8" />
6 <title>StarCraft ][ Clan summary</title>
7 </head>
8
9 <body>
10 <p id="clan">No clan data</p>
11 <script>
12         fetch('/schtarr/inno.json')
13         .then(res => res.json())
14         .then(json => {
15                 let out = document.getElementById('clan');
16                 out.innerHTML = `<h1>${json.tag}</h1><h2 title="Division ${json.division}">${json.league} <small>#${json.rank}</small></h2>`
17                         + json.members.map(member => `<a href="${member.profileUrl}"><img src="${member.avatarUrl}" title="${member.name}" /></a>`).join('');
18         })
19         .catch(error => console.log(error))
20 </script>
21 </body>
22
23 </html>