Comment on What are the activity_id formats for various platforms?
moseschrute@lemmy.world 2 weeks ago
I maintain my own Lemmy client (Blorp), and this sounds like a cool idea. How do you get your known list of federated instances?
I currently have my own threadiverse crawler I wrote, but I disgusted any Lemmy/PieFed instance with <20 monthly active users. That brings the list down to about 63 Lemmy instances and 7 PieFed. I wonder if that list is extensive enough to implement the resolve object mechanism you mentioned.
admiralpatrick@lemmy.world 2 weeks ago
At startup, it calls
/api/v3/federated_instances
and stores the result to a lookup variable. Then I’ve got a couple of helper functions that accept either an instance ID or a domain name which looks them up from the lookup variable.moseschrute@lemmy.world 2 weeks ago
Ahh that makes sense. I guess you couldn’t search anything your instance doesn’t federate with anyway.
admiralpatrick@lemmy.world 2 weeks ago
I believe you can, yeah, and I also think that “bootstraps” that instance to yours if it doesn’t already know about it. But in that case, the way I have the search written, it’ll “fall back” to regular search which also does
resolveObject
. That just takes longer.The ap_id check is just to short-circuit that behavior to avoid the lengthy, often unnecessary, search and quickly redirect you to your instance’s local copy.
Have had that working for about a week now, and it’s pretty nice. Please do steal this feature lol.
moseschrute@lemmy.world 2 weeks ago
I believe it bootstraps the object, not the instance. You still won’t be able to find an object from an instance you don’t federate with.
This is based on an explanation from @MrKaplan@lemmy.world, unless I misunderstood MrKaplan?