Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use getFeedSkeleton and getFeed API #129

Open
leachuk opened this issue Dec 9, 2024 · 0 comments
Open

How to use getFeedSkeleton and getFeed API #129

leachuk opened this issue Dec 9, 2024 · 0 comments

Comments

@leachuk
Copy link

leachuk commented Dec 9, 2024

I'd like to build out my own feed client for testing of my own feed generator.

I have the custom feed generator available on my local network and can access is fine with

const agent = new AtpAgent({
  service: "http://192.168.0.94:30100"
});

feedRes = await agent.app.bsky.feed.getFeed({
  feed: "at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf"
});

But when I try and hit that endpoint outside of the JS client, e.g. in the browser or curl, I get an error

curl -G GET 'http://192.168.0.94:30100/xrpc/app.bsky.feed.getFeed' \
  -d 'feed=at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf' \
  -d 'limit=5'

# Results in curl: (6) Could not resolve host: GET

However, I can change the curl command to use getFeedSkeleton and it works as expected

curl -G GET 'http://192.168.0.94:30100/xrpc/app.bsky.feed.getFeedSkeleton' \
  -d 'feed=at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf' \
  -d 'limit=5'

And this may or may not be related, but I don't appear to be able to getFeedSkeleton for any feed via a remote (none localhost, which does work) host. So this doesn't work (I've tried multiple hostnames)

curl -X GET https://api.bsky.app/xrpc/app.bsky.feed.getFeedSkeleton \
  -H "Authorization: Bearer TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "feed": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot",
    "limit": 20
  }'

It would be nice to understand why I'm seeing this behaviour.

@leachuk leachuk changed the title How to use getFeedSkeleton API How to use getFeedSkeleton and getFeed API Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant