Skip to content

How to read the "Discover" Feed? #407

Discussion options

You must be logged in to vote

Hello,

from atproto import Client, models


def main() -> None:
    client = Client()
    client.login('handle', 'password')

    discover_feed_uri = 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot'

    feed_response = client.app.bsky.feed.get_feed(models.AppBskyFeedGetFeed.Params(feed=discover_feed_uri))
    for post_view in feed_response.feed:
        author = post_view.post.author.handle
        text = post_view.post.record.text.replace('\n', ' ')
        print(f'{author}: {text}')

Keep in mind that you need to implement pagination using feed_response.cursor if you want to fetch more posts. Here is the example

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MatthiasThoemel
Comment options

Answer selected by MatthiasThoemel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants