ActivityPub
So I've been trying to learn more about ActivityPub lately, but it's been pretty hard to get started.
I tried reading the spec, but it's not that helpful. It's vague and hard to understand. I just want to see some examples I can plug into postman. Also, the examples they show are useless without showing the headers you would need to add to the request.
There are some tutorials by Eugen (Gargron). They are ok, but I couldn't get his examples to work. (I'm sure they are great examples, but I don't know enough to debug/modify them to work for me)
There's a whole website activitypub.rocks that really tries to group all the activitypub info together, common libraries, projects, theres a test suite, but no examples.
So what finally worked? I just downloaded the #Friendica code and started stepping through it in PHPStorm! and I would recommend anyone wanting to learn more about #ActivityPub do the same. Its a little work setting it up, but you can just set breakpoints and watch all the activitypub requests as they happen and see how they are used!
I tried reading the spec, but it's not that helpful. It's vague and hard to understand. I just want to see some examples I can plug into postman. Also, the examples they show are useless without showing the headers you would need to add to the request.
There are some tutorials by Eugen (Gargron). They are ok, but I couldn't get his examples to work. (I'm sure they are great examples, but I don't know enough to debug/modify them to work for me)
There's a whole website activitypub.rocks that really tries to group all the activitypub info together, common libraries, projects, theres a test suite, but no examples.
So what finally worked? I just downloaded the #Friendica code and started stepping through it in PHPStorm! and I would recommend anyone wanting to learn more about #ActivityPub do the same. Its a little work setting it up, but you can just set breakpoints and watch all the activitypub requests as they happen and see how they are used!
2 people like this
Sean Tilley 2 years ago •
The big thing is that this is a network comprised of Actors. An Actor is usually a Person, but it can otherwise be an Organization or a Group. Actors perform Activities on Objects - generally, these interactions can be represented in a stream of some kind.
In the ActivityPub world, Actors have an Inbox for ingesting subscribed content (activities and objects from other actors), and an Outbox for dispatching their own stuff, which is then sent out to a collection of Followers. Most implementations have a notion of permissions, in the sense of who is allowed to parse or even receive an Activity.
Of course, the protocol and implementations go way deeper into that, but this is the general gist of how ActivityPub is supposed to work.
ActivityPub
www.w3.org~binput-mothex 2 years ago •
3 people like this
Sean Tilley, Ademan and Kevin like this.
Kevin 2 years ago
It's a pretty big spec and kinda overwhelming,
I haven't even read about OStatus or the Diaspora protocol yet, but I should really look at them too. Maybe I'll do that next week.
I think the biggest problem I had is, if you want to start from scratch, you have to write quite a bit of code just to post a message to mastodon/friendica, and I had a much easier time looking at an existing project's code than writing my own. (I'm lousy at web programming. I mostly write desktop apps in C#)
Also, I just want to say, I'm amazed level of interoperability between all these projects (especially mastodon, pixelfed, pleroma and friendica)
smallcircles (Humane Tech Now) 2 years ago •
#SocialHub community is good for asking questions, and in the archive of topics you may find a lot of helpful stuff.
https://socialhub.activitypub.rocks/t/guide-for-new-activitypub-implementers/479
Guide for new ActivityPub implementers
SocialHub2 people like this
Sean Tilley and Kevin like this.
Sean Tilley 2 years ago •
smallcircles (Humane Tech Now) 2 years ago •
@kevin are you familiar with the #Fediverse #delightful lists? They can be found at https://codeberg.org/fediverse
fediverse
Codeberg.orgKevin likes this.
Kevin 2 years ago
smallcircles (Humane Tech Now) likes this.
Emacsen 2 years ago •
Sadly AP breaks the actor model *caugh*because Mastodon*caugh* but otherwise it fits the model pretty well and thus could use an alternate transport such as what @pukkamustard is doing.
Sean Tilley likes this.
Sean Tilley 2 years ago •
Emacsen 2 years ago •
In an Actor model system, messages are sent to an actor.
In ActivityPub, sharedInbox breaks the actor model by placing work on the server to filter on whether or not the message should be delivered to the recipient, rather than sending it to multiple recipients.
This violates the principle in an actor model system that an Actor should be the computational unit of work.
...
Emacsen 2 years ago •
The right (tm) way of handling this IMHO is to either not offer a sharedInbox or else to have a special Actor called _all whose job it would be to decide who to deliver to, but by using this concept called a sharedInbox, you violate that principle.
https://www.oreilly.com/library/view/scala-reactive-programming/9781787288645/8253d31d-ed61-46c3-8c69-9d49d8d8ab07.xhtml
Scala Reactive Programming
O’Reilly Online Learning