I don't really understand the difference between ActivityPub and Mastodon yet.
If I write my own ActivityPub software (server code with web frontend), can I interact with Mastodon users just as if I also were a Mastodon user? Or would I have to implement some Mastodon specific protocols?
I don't know the fediverse protocol yet, but I would hope I can get away with just two files like this:
receive.php
<?php
if (!isset(servers_i_talk_to[$_SERVER['REMOTE_ADDR']]) die();
$data = $_POST['msg']
$file = 'log/' + time().'-'.mt_rand();
file_put_contents($file, $data);
send.php <?php
$data=$_POST['data'];
for ($servers_i_talk_to as $server) {
$url = "https://$server/receive.php";
$msg = ['msg'=>$data];
$opts = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($msg)
]
];
$context = stream_context_create($opts);
file_get_contents($url, false, $context);
}
Where receive.php is openly accessible and send.php is protected by a password.The endpoints are surely called differently than receive.php and send.php. But this is how I would hope ActivityPub works in principle.
Of course, this would be very bare. To read, I would have to read the raw log of ActivityPub messages and to post, I would have to manualy put together an ActivityPub message.
But I would be in the Fediverse and could add more convenience functionality later.
In order to federate an object you must:
- send requests with proper 'HTTP Signatures' (many AP nodes have strict enforcement here)
- which requires you to have an actor with an attached signing pubkey
- so you have to host the LD-JSON actor descriptor on another endpoint
- actors MUST have an attached inbox & outbox, your receive endpoint will need to sit at your actor's inbox (on POST). both of these are OrderedCollections of Activities
- and in order to be properly interoperable you will probably need to maintain follow relations & write an endpoint which can ACK/NAK follows, etc etc
- GoToSocial: https://docs.gotosocial.org/
- Pleroma: https://pleroma.social/
Theoretically you should be able to follow anyone from pixelfed on Mastodon and vice versa because both support ActivityPub. I haven't tried doing that myself.
That's a pretty faithful clone of instagram then…
Musk per his own statements wants to increase free speech… why is that bad?
Regardless, Gab and Truth.social both use mastodon. So it’ll improve their platforms the more people switch (and improve mastsdon). Technically the nodes can interconnect; though I believe that’s not happening today
This is kind of the nature of the beast. If the problem is that the remote instance allows things that you find intolerable, then you have to ban the remote instance from federating with you. Speech may be free, but actions have consequences.
If I'm wrong I believe someone will correct me pretty fast but that's my current understanding.
If the popular solutions are too complex, maybe you want to take a look at https://microblog.pub, a relatively small and simple AP implementation designed for single-user instances.
That page also links to https://blog.joinmastodon.org/2018/06/how-to-implement-a-bas..., which is a demo of hardcoding one part of the spec from scratch.
So yes you can certainly interact with Mastodon users and you will need to.
https://www.r-bloggers.com/2022/10/getting-acquainted-with-m... the largest Mastodon instance has less than a million users. Twitter has, what, 450 million?
(And therefore I’m a little bit ashamed that I have hard time avoiding Mastodon and Twitter. Soooo much new stuff, all the time – not super high quality, though…)