Skip to content

Commit

Permalink
top10
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Nov 11, 2023
1 parent 9847a1f commit fc9acfe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
"npub150qnaaxfan8auqdajvn292cgk2khm3tl8dmakamj878z44a6yntqk7uktv", // 流速ちゃn
"npub1f6rvmwc76arl7sxx2vparlzx8cg2ajc3xpymqh7yx97znccue2hs5mkavc", // ぬるぽ
"npub1w7g33p5hrljhnl37f7gdnhr7j87dwjzsms59x6qllutk2jepszgs65t8dc", // ビットコイン
"npub17a50460j8y99yglsqzjzfh4exq4f8q0r82ackzzv4pz0dyd3rnwsxc9tp2", // buzzword
}
)

Expand Down Expand Up @@ -223,14 +224,14 @@ func postRanks(ev *nostr.Event) {
}
items = append(items, item)
}
if len(items) < 5 {
if len(items) < 10 {
return
}
sort.Slice(items, func(i, j int) bool {
return items[i].Count > items[j].Count
})
if len(items) > 5 {
items = items[:5]
if len(items) > 10 {
items = items[:10]
}

var buf bytes.Buffer
Expand Down

0 comments on commit fc9acfe

Please sign in to comment.