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

Question: How to get member count of lists (curation and moderation lists)? #13

Open
MagicAndre1981 opened this issue Jan 14, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@MagicAndre1981
Copy link

I would like to know the number of users who are on my own created list. I searched a bit in the code but can't find it. Is this implemented?

@drasticactions
Copy link
Owner

I recommend reading through the ATProtocol Lexicon lists to see if it exists there first. Then, cross-section that with the list in the README.

In this case, that information should be available in getList, which is not implemented here yet.

@drasticactions drasticactions added the enhancement New feature or request label Jan 14, 2024
@MagicAndre1981
Copy link
Author

In this case, that information should be available in getList, which is not implemented here yet.

ok, thanks.

@drasticactions
Copy link
Owner

27bca12

I've updated the README to update the supported/unsupported endpoints (I had a few I did implement and didn't add back there). I also wrote a little tool to help keep track when the protocol updates to know if something gets added or removed to keep that list in check: https://github.com/drasticactions/FishyFlip/tree/main/tools/LexiconTools

I can get to it when I have a chance, but it shouldn't be too hard to add that one should you or anyone else want to. It should just be adding a new endpoint and record response for it, and the endpoint to the Graph class, basically replicating what the other ones do.

@drasticactions
Copy link
Owner

drasticactions commented Jan 15, 2024

@MagicAndre1981 I just released a new version with the rest of the Graph APIs, including getList which should get you what you want.

// This endpoint requires authorization. If you don't have it, it will throw an auth error.
// Get the List ATURI.
var repo = ATUri.Create(@"at://did:plc:yhgc5rlqhoezrx6fbawajxlh/app.bsky.graph.list/3kiwyqwydde2x");
// Gets information about the list, including who is following it.
var lists = (await protocol.Graph.GetListAsync(repo)).HandleResult();
// Gets a sample of posts from the list.
var feed = (await protocol.Feed.GetListFeedAsync(repo)).HandleResult();

Let me know if this works for you.

@MagicAndre1981
Copy link
Author

thanks, 1.5.25 works and with

var profile = (await protocol.Identity.ResolveHandleAsync(ATHandle.Create("HANDLENAME")!)).HandleResult();
var lists = (await protocol.Graph.GetListsAsync(profile.Did)).HandleResult();

I'm able to get the lists. In 1.4.19 it always crashed (JsonException, InvalidOperationException). I can see the purpose (app.bsky.graph.defs#curatelist) that is great.

But now I need to get the number of users added to a specific list. I've expected a Collection Property with the members where I can call Count. Do I need to run an extra call to fetch the members of the list?

@MagicAndre1981
Copy link
Author

Do I need to run an extra call to fetch the members of the list?

looks so, we need to do an extra call 'list-members'

@MagicAndre1981
Copy link
Author

Ok, there seems to be a getListCount function, but how can we call this from .NET?

@drasticactions
Copy link
Owner

Going by the commits, it was implemented as part of an update to the AppView so I have not implemented it yet.

@drasticactions
Copy link
Owner

@MagicAndre1981 So I checked in the BSky Dev Discord and that code isn't accessible by any exposed xrpc endpoint. So I can't implement access to it, it's internal.

In general, I would look in the lexicons first for functions that can be accessible by clients like this. If it's not there, then it most likely isn't something that we can call.

@MagicAndre1981
Copy link
Author

ok, thanks for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants