shithub: hell

Download patch

ref: 835119bba5d3268f18bca56be3e092ced9c37c04
parent: fd05c4d03acab4d10384ef5dad011dc685ffcc1d
author: penny <penny@limitedideas.org>
date: Sun Oct 5 06:13:54 EDT 2025

renderer stringers

--- a/main.go
+++ b/main.go
@@ -259,8 +259,12 @@
 					index = lastindex
 				}
 				formatter := &StatusFormatter{hc: hc, status: postItem, postContext: hc.ctxref}
-				fmt.Println(hyphenate(fmt.Sprintf("%s> %s %s\n", index, formatter.username(), formatter.statusContent())))
-				fmt.Print(formatter.detailLine())
+				var sb strings.Builder
+				sb.WriteString(fmt.Sprintf("%s> %s %s", index, formatter.username(), formatter.statusContent()))
+				sb.WriteString(formatter.mediaDescriptions())
+				sb.WriteString(formatter.detailLine())
+				sb.WriteString("\n")
+				fmt.Print(hyphenate(sb.String()))
 				return
 			case "like":
 				_, err := client.Favourite(context.Background(), postItem.ID)
--- a/renderer.go
+++ b/renderer.go
@@ -27,6 +27,18 @@
 	return renderedPost
 }
 
+func (st *StatusFormatter) mediaDescriptions() string {
+	var sb strings.Builder
+	for _, item := range st.status.MediaAttachments {
+		if item.Description != "" {
+			sb.WriteString(fmt.Sprintf("\n🖼️[%s]", item.Description))
+			continue
+		}
+		sb.WriteString("🖼️")
+	}
+	return sb.String()
+}
+
 func (st *StatusFormatter) username() string {
 	var sb strings.Builder
 	sb.WriteString("<")
@@ -57,6 +69,34 @@
 	sb.WriteString("\n")
 	return sb.String()
 }
+
+// Status content stringer
+type statusContent struct {
+	*StatusFormatter
+}
+
+func (cf *statusContent) String() string {
+	return cf.statusContent()
+}
+
+// Media description stringer
+type mediaDescriptions struct {
+	*StatusFormatter
+}
+
+func (md *mediaDescriptions) String() string {
+	return md.mediaDescriptions()
+}
+
+// Post detail line (likes rts replies) stringer
+type detailLine struct {
+	*StatusFormatter
+}
+
+func (dl *detailLine) String() string {
+	return dl.detailLine()
+}
+
 
 func (hc *Hellclient) renderStatus(content string, index string) (string, map[string]string) {
 	doc, err := html.Parse(strings.NewReader(content))
--