Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

curators.gno

0.72 Kb · 23 lines
 1package home
 2
 3import (
 4	"strings"
 5
 6	"gno.land/p/nym-alexiscolin000/gnoradio/text/v0"
 7
 8	"gno.land/r/nym-alexiscolin000/gnoradio/radio/v1"
 9)
10
11// topCurators lists a station's best pickers this week (radio/curators.gno).
12func topCurators(st int) string {
13	top := radio.TopCurators(st)
14	if len(top) == 0 {
15		return ""
16	}
17	var b strings.Builder
18	b.WriteString("## Top curators this week\n\nA pick and a tip received while it is on air score one point each. Pickers earn the artist's promo share of those tips.\n\n")
19	for i, c := range top {
20		b.WriteString(text.Itoa(i+1) + ". " + who(c.Address) + " · " + plural(c.Picks, "pick") + " · " + plural(c.Tips, "tip") + " · earned " + text.GNOT(c.Earned) + "\n")
21	}
22	return b.String() + "\n"
23}