shithub: hell

Download patch

ref: ae797a6ea55f56aef33514eb25af7b4bb2e41bb3
parent: 94101d5e1987152d249b76faebdecdb463184d23
author: penny <penny@limitedideas.org>
date: Mon Oct 20 16:35:16 EDT 2025

add support for public and local timelines

--- a/commands.go
+++ b/commands.go
@@ -4,7 +4,7 @@
 	"strings"
 )
 
-var commands = []string{"examine", "reply", "like", "thread", "open", "prev", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "view", "bookmarks", "follow", "unfollow", "likes", "help", "reload", "attach", "detach", "pinned", "cat", "play", "translate", "read", "version"}
+var commands = []string{"examine", "reply", "like", "thread", "open", "prev", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "view", "bookmarks", "follow", "unfollow", "likes", "help", "reload", "attach", "detach", "pinned", "cat", "play", "translate", "read", "version", "local", "public"}
 
 func processInput(input string) (command string, arguments string, found bool) {
 
--- a/help.go
+++ b/help.go
@@ -15,6 +15,8 @@
   /like <index>                Favorite status by index.
   /thread <index>              View thread the indexed status is part of.
   /cat <index>                 Output a status with details (liker, replies, etc).
+  /public                      Open federated timeline page.
+  /local                       Open instance local timeline page.
   /open <index>                Open indexed status in the system web browser.
   /download <index>            Download attached files/media from status.
   /view <index>                Preview status media in media viewer.
--- a/main.go
+++ b/main.go
@@ -245,6 +245,34 @@
 				fmt.Print(hc.page.String())
 				hc.pause(true)
 				return
+			case "local":
+				if arguments != "" {
+					hc.dispatchStatus(arguments, "direct")
+					return
+				}
+				hc.page = &Page{}
+				localAPI := func(ctx context.Context, pg *mastodon.Pagination) ([]*mastodon.Status, error) {
+					return hc.client.GetTimelinePublic(ctx, true, pg)
+				}
+				getter := &BasicStatusGetter{getter: localAPI}
+				hc.page.loader = &StatusPages{hc: hc, getter: getter}
+				fmt.Print(hc.page.String())
+				hc.pause(true)
+				return
+			case "public":
+				if arguments != "" {
+					hc.dispatchStatus(arguments, "direct")
+					return
+				}
+				hc.page = &Page{}
+				localAPI := func(ctx context.Context, pg *mastodon.Pagination) ([]*mastodon.Status, error) {
+					return hc.client.GetTimelinePublic(ctx, false, pg)
+				}
+				getter := &BasicStatusGetter{getter: localAPI}
+				hc.page.loader = &StatusPages{hc: hc, getter: getter}
+				fmt.Print(hc.page.String())
+				hc.pause(true)
+				return
 			}
 
 			if arguments == "" && !postOK {
--