this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

additional demo fetch showing LexClient usage

+41 -3
+41 -3
atproto/client/cmd/atp-client-demo/main.go
··· 7 7 "log/slog" 8 8 "os" 9 9 10 + comatproto "github.com/bluesky-social/indigo/api/agnostic" 10 11 "github.com/bluesky-social/indigo/atproto/client" 11 12 "github.com/bluesky-social/indigo/atproto/identity" 12 13 "github.com/bluesky-social/indigo/atproto/syntax" ··· 27 28 &cli.StringFlag{ 28 29 Name: "host", 29 30 Value: "https://public.api.bsky.app", 31 + Usage: "service host", 32 + }, 33 + }, 34 + }, 35 + &cli.Command{ 36 + Name: "list-records-public", 37 + Usage: "do a basic GET request (listRecords)", 38 + Action: runListRecordsPublic, 39 + Flags: []cli.Flag{ 40 + &cli.StringFlag{ 41 + Name: "host", 42 + Value: "https://enoki.us-east.host.bsky.network", 30 43 Usage: "service host", 31 44 }, 32 45 }, ··· 107 120 app.RunAndExitOnError() 108 121 } 109 122 110 - func simpleGet(ctx context.Context, c *client.APIClient) error { 123 + func getFeed(ctx context.Context, c *client.APIClient) error { 111 124 params := map[string]any{ 112 125 "actor": "atproto.com", 113 126 "limit": 2, ··· 128 141 return nil 129 142 } 130 143 144 + func listRecords(ctx context.Context, c *client.APIClient) error { 145 + 146 + list, err := comatproto.RepoListRecords(ctx, c, "app.bsky.actor.profile", "", 10, "did:plc:ewvi7nxzyoun6zhxrhs64oiz", false) 147 + if err != nil { 148 + return err 149 + } 150 + 151 + out, err := json.MarshalIndent(list, "", " ") 152 + if err != nil { 153 + return err 154 + } 155 + fmt.Println(string(out)) 156 + return nil 157 + } 158 + 131 159 func runGetFeedPublic(cctx *cli.Context) error { 132 160 ctx := cctx.Context 133 161 ··· 135 163 Host: cctx.String("host"), 136 164 } 137 165 138 - return simpleGet(ctx, &c) 166 + return getFeed(ctx, &c) 167 + } 168 + 169 + func runListRecordsPublic(cctx *cli.Context) error { 170 + ctx := cctx.Context 171 + 172 + c := client.APIClient{ 173 + Host: cctx.String("host"), 174 + } 175 + 176 + return listRecords(ctx, &c) 139 177 } 140 178 141 179 func runLoginAuth(cctx *cli.Context) error { ··· 183 221 } 184 222 c = c.WithService(cctx.String("appview")) 185 223 186 - return simpleGet(ctx, c) 224 + return getFeed(ctx, c) 187 225 } 188 226 189 227 func runLookupAdmin(cctx *cli.Context) error {