ref: 4cfa80e54383d0b734421ada9c37b664598aa232
parent: 1a285e71a303add704a835eb7b49010b53cdac82
author: penny <penny@limitedideas.org>
date: Tue Sep 23 10:06:19 EDT 2025
Remove some %v's
--- a/mastodon.go
+++ b/mastodon.go
@@ -103,7 +103,7 @@
href = node.Attr[attr].Val
//Replace the href with the description if the URL has one
if node.FirstChild != nil && node.FirstChild.Type == html.TextNode && !ismention {- node.Attr[attr].Val = fmt.Sprintf("(%v)", node.FirstChild.Data)+ node.Attr[attr].Val = fmt.Sprintf("(%s)", node.FirstChild.Data) } else {href = href + " "
}
@@ -216,12 +216,12 @@
func (hc *Hellclient) formatAccount(account *mastodon.Account) string {var sb strings.Builder
- sb.WriteString(fmt.Sprintf("%v\n", account.DisplayName))- sb.WriteString(fmt.Sprintf("%v <%v>\n", account.Username, account.Acct))+ sb.WriteString(fmt.Sprintf("%s\n", account.DisplayName))+ sb.WriteString(fmt.Sprintf("%s <%s>\n", account.Username, account.Acct)) sb.WriteString(fmt.Sprintf("Posts: %v Followers: %v Following: %v\n", account.StatusesCount, account.FollowersCount, account.FollowingCount)) sb.WriteString(fmt.Sprintf("Created %v\n", account.CreatedAt)) sb.WriteString(fmt.Sprintf("Locked: %v\n", account.Locked))- sb.WriteString(fmt.Sprintf("%v\n\n", html2text.HTML2Text(account.Note)))+ sb.WriteString(fmt.Sprintf("%s\n\n", html2text.HTML2Text(account.Note))) relationships, err := hc.client.GetAccountRelationships(context.Background(), []string{string(account.ID)})relationship := relationships[0]
@@ -248,26 +248,26 @@
// Spaces before prefixes (no space if you're not passing a prefix)
func (hc *Hellclient) formatReblog(post *mastodon.Status, index string) string {- reblogString := fmt.Sprintf(" <%v> Reblogged", post.Account.Username)+ reblogString := fmt.Sprintf(" <%s> Reblogged", post.Account.Username)return hyphenate(hc.formatStatusDetailed(post.Reblog, index, reblogString))
}
func (hc *Hellclient) formatWithPrefix(post *mastodon.Status, index string, prefix string) string {- postString := fmt.Sprintf("%v %v>", prefix, index)+ postString := fmt.Sprintf("%s %s>", prefix, index)return hyphenate(hc.formatStatusDetailed(post, "", postString))
}
func (hc *Hellclient) formatFavorite(post *mastodon.Status, index string) string {- favString := fmt.Sprintf("Favorited: %v", index)+ favString := fmt.Sprintf("Favorited: %s", index)return hyphenate(hc.formatStatusDetailed(post, "", favString))
}
func (hc *Hellclient) formatBookmark(post *mastodon.Status, index string) string {- favString := fmt.Sprintf("Bookmarked: %v", index)+ favString := fmt.Sprintf("Bookmarked: %s", index)return hyphenate(hc.formatStatusDetailed(post, "", favString))
}
func (hc *Hellclient) formatUnbookmark(post *mastodon.Status, index string) string {- favString := fmt.Sprintf("Unbookmarked: %v", index)+ favString := fmt.Sprintf("Unbookmarked: %s", index)return hyphenate(hc.formatStatusDetailed(post, "", favString))
}
@@ -278,7 +278,7 @@
func (hc *Hellclient) formatStatusDetailed(post *mastodon.Status, index string, prefix string) string {renderedPost, plaintexts := hc.renderStatus(post.Content, index)
- rendered := fmt.Sprintf("%v>%v <%v> %v", index, prefix, post.Account.Username, html2text.HTML2Text(renderedPost))+ rendered := fmt.Sprintf("%s>%s <%s> %s", index, prefix, post.Account.Username, html2text.HTML2Text(renderedPost)) for key, plaintext := range plaintexts {rendered = strings.Replace(rendered, key, plaintext, 1)
}
@@ -286,7 +286,7 @@
}
func (hc *Hellclient) formatEdit(post *mastodon.Status, index string) string {- editString := fmt.Sprintf(" <%v> EDITED:", post.Account.Username)+ editString := fmt.Sprintf(" <%s> EDITED:", post.Account.Username)return hyphenate(hc.formatStatusDetailed(post, index, editString))
}
@@ -324,13 +324,13 @@
for _, item := range media { if item.Description != "" {- postfix += fmt.Sprintf("\n🖼️[%v]", item.Description)+ postfix += fmt.Sprintf("\n🖼️[%s]", item.Description)continue
}
postfix += "🖼️"
}
- plaintext = fmt.Sprintf("%v %v", poststring, postfix)+ plaintext = fmt.Sprintf("%s %s", poststring, postfix)return
}
--
⑨