From 315f12485c49b5cd5c5d33e74355400dc0405c63 Mon Sep 17 00:00:00 2001 From: Christopher Jr Riley Date: Sat, 7 Dec 2024 11:51:45 -0500 Subject: [PATCH] Update example in getting started article --- .../ATProtoKit.docc/Getting Started with ATProtoKit.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/ATProtoKit/ATProtoKit.docc/Getting Started with ATProtoKit.md b/Sources/ATProtoKit/ATProtoKit.docc/Getting Started with ATProtoKit.md index d59abe9947..2ad6c93694 100644 --- a/Sources/ATProtoKit/ATProtoKit.docc/Getting Started with ATProtoKit.md +++ b/Sources/ATProtoKit/ATProtoKit.docc/Getting Started with ATProtoKit.md @@ -78,8 +78,13 @@ You should see the post in your Bluesky account once you run this code. When the To view your own posts, you can use ``ATProtoKit/ATProtoKit/getAuthorFeed(by:limit:cursor:postFilter:shouldIncludePins:)`` and use ``UserSession/handle`` in the first argument: ```swift -let myFeed = try await atProto.getAuthorFeed(by: "lucy.bsky.social") -print("Feed: \(myFeed)") +do { + guard let session = atProto.session else { return } + let myFeed = try await atProto.getAuthorFeed(by: session.handle) + print("Feed: \(myFeed)") +} catch { + throw error +} ``` By default, it will grab the first 50 posts from you, including replies, and without the pinned post. However, you can tweak that with the `limit`, `postFilter`, and `shouldIncludePins` arguments. You can also poll more posts if a singular call reaches its limit by using ``AppBskyLexicon/Feed/GetAuthorFeedOutput/cursor`` with the next API call: