6 ms·
Ask HN: ActivityPub or Mastodon?
I am thinking about joining the Fediverse.
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?
- smcn 4y agoYes, it'll federate with Mastodon, with no extra effort or code.
- smcl 4y agoOur usernames are nearly neighbours :-O
- piva00 4y agoAFAIK: ActivityPub is the protocol used by Mastodon and other platforms (like PeerTube) and so you'd be able to interact with other users using the protocol. If I'm wrong I believe someone will correct me pretty fast but that's my current understanding.
- 2Gkashmiri 4y agono. activitypub is the protocol which all apps in the fediverse use and can talk to each other. you can create a pixelfed instance account and follow someone on mastodon.social and vice versa. same for interaction between them
- pedrogpimenta 4y agoSo... yes?
- 2Gkashmiri 4y agoyes
- pedrogpimenta 4y agoI'm curious why you started your answer with "no"?
- watchdogtimer 4y agoBefore you go to the trouble of writing your own software, consider using one that's already been written. There are many[0] out there already besides Mastodon. [0]- https://delightful.club/delightful-fediverse-apps/ https://delightful.club/delightful-fediverse-apps/
- Timja 4y agoThanks, will look through these. But all of the ones I have looked at so far seem pretty complex with hundreds of files. 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.
- half-kh-hacker 4y agoIt's not so simple. 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
- anthropodie 4y agoWhile everyone is talking about Mastodon because of Twitter, I want people to know that there is https://pixelfed.social https://pixelfed.social which is alternative to Instagram. 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.
- jeffalyanak 4y agoYeah, that works.
- edent 4y agoYou can! I'm following @ username @pixelfed.social in my Mastodon client.
- jerrygoyal 4y agothe homepage (Pixelfed) url is just a login screen with no explore page or even a landing page. not sure if that's a sign of a good product.
- anthropodie 4y agoHere you go https://pixelfed.social/discover https://pixelfed.social/discover. No idea why they would not put that on homepage.
- Timja 4y agoThe trending images have only a handful of likes. Are likes not federated through the Fediverse? If someone on mastodon.social likes a post on pixelfed.social, will that increase the like count on pixelfed.social?
- deleted 4y ago[deleted]
- Kye 4y agoThe dev is working on a major update to the Pixelfed equivalent of joinmastodon.org.
- xena 4y agoActivityPub : Mastodon :: SMTP : postfix
- k__ 4y agoDoes this mean, I can use any AP implementation to federate with Mastodon servers?
- Kye 4y agoAs long as it implements the same activities. They often do.
- ryukafalz 4y agoRoughly yes, though you'll want one that supports the same activity types (Mastodon mostly uses "Note") or it won't make much sense :)
- k__ 4y agoHow many types are there and how prevalent are they? I read some websites about "host your own server" and some were talking explicitly about Mastodon and some were like "let's do selfhostes microblogging with this AP server" And I asked myself, if I could use AP servers to follow people and let them follow me when they're on a public Mastodon instance.
- Matl 4y agoYes, abet Mastodon has some non-standard extensions. But basically yes.
- andrewstuart 4y agoMeanwhile………. Twitter is just a text field (basically).
- ydf 4y agoBest not to waste your time on any of this microblogging rubbish. It only leads to misery.
- cpach 4y agoTo each their own but I personally believe that’s sound advice. (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…)
- kzrdude 4y agoWell, avoiding twitter is easy. Sadly it's relatively often one comes across great things to follow, let's just take @pcwalton as a recent example. :)
- cpach 4y agoThere are loads of smart and interesting people on Twitter. I don’t deny that. I have just grown tired of microblogging in general, and Twitter in particular. The overall signal:noise ratio is just too low, IMHO.
- kzrdude 4y agoI was trying to cut out "stuff I do on the internet habitually", i.e just scrolling. Twitter is the least missed item on the list. But I seem to slip back onto internet habits time and again.. What has once been won must be won again.
- emaro 4y agoThe difference between ActivityPub and Mastodon was already explained by others. If the popular solutions are too complex, maybe you want to take a look at https://microblog.pub https://microblog.pub, a relatively small and simple AP implementation designed for single-user instances.
- Timja 4y agoThanks. 153 files. An order of magnitude leaner than the ones I have seen so far.
- chx 4y agoMastodon won't survive this, the Fediverse will. Much as Twitter when it was a Rails app buckled under the load already we see things like https://github.com/mastodon/mastodon/issues/19505 https://github.com/mastodon/mastodon/issues/19505 and users of other instances also complain. It's an old crusty complex codebase. So yes you can certainly interact with Mastodon users and you will need to. https://www.r-bloggers.com/2022/10/getting-acquainted-with-mastodon-instances/ 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?
- JackC 4y agoFor anyone looking to mess around with making a single file ActivityPub server, this looks like a good intro to the spec: https://socialhub.activitypub.rocks/t/guide-for-new-activitypub-implementers/479 https://socialhub.activitypub.rocks/t/guide-for-new-activity... That page also links to https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server/ https://blog.joinmastodon.org/2018/06/how-to-implement-a-bas..., which is a demo of hardcoding one part of the spec from scratch.