Understanding ActivityPub and Federation
I have tried to understand how Federation works but I’m getting a feeling that there’s some rather large gaps here. My first attempt was to find an API implementation in python, 3 wasted hours of my life later and I’m making requests.request() calls like it’s 2007. And I still can’t access the content as presented on the webinterfaces. There doesn’t seem to be a way to access eg the communities tab via activitypub? Any Help?
There doesn’t seem to be a way to access eg the communities tab via activitypub? Any Help?
If you’re writing client-to-server part (not server-to-server part), try
curl 'https://<lemmy-instance>/api/v3/community/list?sort=Hot'
, and an API client libraries written in Python..Hi, I’m well aware of those APIs, but the idea was to find a unified way using ActivityPub. As it stands AP seems to actually have this glaring omission at its core. I’m somewhat baffled how this skipped past so many interations. What you mentioned is certainly a valid option to access data on lemmy. But it won’t work on Mastodon, or any other service only linked via ActivityPub Federation. And that’s a problem. It splits the network apart at the seams.
ActivityPub is what instances use to talk to each other, not what the web interface uses. So the way Communities are propagated over the ActivityPub depends on what lemmy does, not what ActivityPub wants. Are you trying to develop your own instance or are you trying to make a 3rd party UI for lemmy?
@Hexorg I’ve begun yesterday with the question “why can’t I access information without first having to know where it is?” I’ve now basically gone through confusion, anger, disbelieve and now acceptance that there really is nothing to find. In the end the concept of federation says that stuff should be accessible from anywhere. But it isn’t. Which is a pretty big problem imo.
My goal is to indeed create a generic fediverse reader, not using any specific platform APIs.I’m working on something similar in swift and started my project with the assumption that I’ll need different API classes for every type of “instance” I want to gather data from (mastadon, lemmy, kbin, etc) and custom server model objects for each instance (as while some properties might be standard across all instances there will probably be some that are specific to an instance(s)).
Then I’ll need those objects to be wrapped in a unified protocol to access and display them. Certainly not ideal, and does seem counterintuitive to the idea of the fedi-verse; but hopefully something for activity pub to work towards.
@evilviper I’ve actually gone ahead and begun work despite lack of discovery. https://github.com/JustusW/UnifiedFediverseObserver
Early stages, but I already can go through linked relations in many cases.