Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

What are the activity_id formats for various platforms?

Fediverse
12 5 84
  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    From my own experience querying public mastodon timelines via API (edit: removed incorrect /api/v1s in the AP_IDs):

    • Mastodon user accounts have an ActivityPub URI of https://<instance.domain.tld>/users/<username>
    • Mastodon posts have an ActivityPub URI of https://<instance.domain.tld>/users/<post_author_username>/statuses/<post_id> (they also have a url property of https://<instance.domain.tld>/@<post_author_username>/<post_id> but that tends to serve the html view of the post)

    To see for yourself, pick an instance that allows viewing their public timeline without logging in (mastodon.social is perfect for this) and follow the "Playing with public data" section of the docs. That page ellides most of the info you're looking for in the example payloads they give (as the JSON payloads themself are quite large and nested), but I can assure you that AP_IDs for user accounts and posts can be found pretty quickly from a single timeline query.

    I don't think Mastodon has any notion of community, nor does it distinguish between posts and comments (when following a lemmy community, both posts and comments show up in my masto feed as "top-level" statuses (ie posts)).

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I’ve rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I’m loving this as it makes things so much faster and easier.

    Isn't that the whole point of webfinger? Moreover, why would you paint yourself into a corner and hardcode the logic for all the different types of services, if ActivityPub uses JSON-LD and therefore provides a straightforward method for document dereferencing?

    I'm not trying to be snarky. It's just that I'm writing ActivityPub server where the id of each object is just an ULID, because to the server there is zero difference between serving the information about an actor or an activity.

  • From my own experience querying public mastodon timelines via API (edit: removed incorrect /api/v1s in the AP_IDs):

    • Mastodon user accounts have an ActivityPub URI of https://<instance.domain.tld>/users/<username>
    • Mastodon posts have an ActivityPub URI of https://<instance.domain.tld>/users/<post_author_username>/statuses/<post_id> (they also have a url property of https://<instance.domain.tld>/@<post_author_username>/<post_id> but that tends to serve the html view of the post)

    To see for yourself, pick an instance that allows viewing their public timeline without logging in (mastodon.social is perfect for this) and follow the "Playing with public data" section of the docs. That page ellides most of the info you're looking for in the example payloads they give (as the JSON payloads themself are quite large and nested), but I can assure you that AP_IDs for user accounts and posts can be found pretty quickly from a single timeline query.

    I don't think Mastodon has any notion of community, nor does it distinguish between posts and comments (when following a lemmy community, both posts and comments show up in my masto feed as "top-level" statuses (ie posts)).

    Cool, thanks. I was close with /user guessing from memory.

    I think the /users/.../post_id will be sufficient. It just needs to know that the given URL is an AP_ID before passing it off to the API call to resolveObject. Since it already knows instance.domain.tld is a federated instance, it just needs to see if the path is an AP_ID or the HTML (or something else). Thus, I don't have to parse the whole thing, just check that enough of it matches.

    Thanks!

  • So, I’ve rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I’m loving this as it makes things so much faster and easier.

    Isn't that the whole point of webfinger? Moreover, why would you paint yourself into a corner and hardcode the logic for all the different types of services, if ActivityPub uses JSON-LD and therefore provides a straightforward method for document dereferencing?

    I'm not trying to be snarky. It's just that I'm writing ActivityPub server where the id of each object is just an ULID, because to the server there is zero difference between serving the information about an actor or an activity.

    We've had this discussion :)

    This application is written against the Lemmy API. It only speaks API. Eventually it'll speak Piefed API as well, but right now, only Lemmy API.

    Lemmy and Piefed only do server-to-server Activity Pub and not client-to-server AP. Clients have to use the API to interact with them. This is a Lemmy (and eventually Piefed) client.

  • We've had this discussion :)

    This application is written against the Lemmy API. It only speaks API. Eventually it'll speak Piefed API as well, but right now, only Lemmy API.

    Lemmy and Piefed only do server-to-server Activity Pub and not client-to-server AP. Clients have to use the API to interact with them. This is a Lemmy (and eventually Piefed) client.

    But then why do you worry about the ap_id patterns from other software?

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    admiralpatrick@lemmy.world I think you would be better served by checking for the Link header. NodeBB and WordPress do it, if that gives you some idea of implementation?

  • It took me a minute to find, but it is detailed in evan@cosocial.ca's write up about HTTP Discovery of ActivityPub Objects.

    This is probably exactly what you're looking for.

    https://swicg.github.io/activitypub-html-discovery/

    I think your current approach has merit but is limited. If you know the instance software by URL and can resolve it using path matching without the use of a pre-flight request, that's absolutely a better way forward. The downside is you have to know the URL patterns of every software. You'll never "catch 'em all"!

    However, if that method fails, doing a pre-flight check to grab Link also works and is a viable way forward.

    You can test against NodeBB users or posts.

  • But then why do you worry about the ap_id patterns from other software?

    I'm making an "omnisearch" box.

    Paste in an AP_ID into the search field, and it auto-resolves it and redirects you to your instance's local copy (which is very fast) instead of going through the whole search process (which is slow). To prevent false positives, I'm matching the various ap_id formats and only doing the resolution on those; anything else gets passed to search.

    Anything else that falls through the cracks just gets passed to search as usual (which also does a resolveObject lookup).

    It's to make life easier.

  • I think you would be better served by checking for the Link header

    Can't really do that, client-side, in a browser application. CORS is a perpetual cockblock (though I understand why it is), and I'd rather not make an internal API endpoint to do the lookup.

    The application polls Lemmy's getFederatedInstances API endpoint at startup, so it has a list of every activity pub server your instance knows about. That's the first and primary check for the URL that's being searched.

    The second check is just to rule out non activity pub URLs that point to a federated instance (e..g. https://lemmy.world/modlog, https://lemm.world/pictrs/image/blah.webp, etc).

    Goal isn't to "catch 'em all" but to catch the most used ones. If there's one I don't account for, either by omission or because the federated platform didn't exist when I made the patterns, then it will just fall back to a regular search which also includes trying to resolve it as a federated URL (which is the current behavior in all prior versions).

    The goal is just to simply short-circuit the search behavior if the query is a known ap_id URL in order to avoid a lengthy search process and quickly redirect you to your instance's local copy.

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    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 disregard 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.

  • I think you would be better served by checking for the Link header

    Can't really do that, client-side, in a browser application. CORS is a perpetual cockblock (though I understand why it is), and I'd rather not make an internal API endpoint to do the lookup.

    The application polls Lemmy's getFederatedInstances API endpoint at startup, so it has a list of every activity pub server your instance knows about. That's the first and primary check for the URL that's being searched.

    The second check is just to rule out non activity pub URLs that point to a federated instance (e..g. https://lemmy.world/modlog, https://lemm.world/pictrs/image/blah.webp, etc).

    Goal isn't to "catch 'em all" but to catch the most used ones. If there's one I don't account for, either by omission or because the federated platform didn't exist when I made the patterns, then it will just fall back to a regular search which also includes trying to resolve it as a federated URL (which is the current behavior in all prior versions).

    The goal is just to simply short-circuit the search behavior if the query is a known ap_id URL in order to avoid a lengthy search process and quickly redirect you to your instance's local copy.

    Can you not call fetch() to do a HEAD call? Maybe I'm mistaken about it but it should be ok.

    CORS is indeed a wrench that gets thrown in when you least expect it...


Gli ultimi otto messaggi ricevuti dalla Federazione
  • > If it's some automated feature, I don't think it should be in the source property of the federated JSON in the first place.

    Thanks, it's this.

    Edit: oh interesting, I looked into it. We serve the absolute URL in HTML but not in markdown. I had no idea threadiverse apps read the markdown. Neat!

    read more

  • Not sure if you're already aware, but that relative link there is broken in Lemmy, Mbin, and Piefed.

    If you used it manually, I'd suggest not using relative links in posts targeted at users from software that hasn't implemented them yet.

    If it's some automated feature, I don't think it should be in the source property of the federated JSON in the first place.

    read more

  • @rekall_incorporated@piefed.social said in [Fediverse wide cross-instance / cross-platform link substitution [UX improvement thoughts&rsqb;](/post/https%3A%2F%2Fpiefed.social%2Fc%2Ffediverse%2Fp%2F1568622%2Ffediverse-wide-cross-instance-cross-platform-link-substitution-ux-improvement-thoughts):
    > This issue is unresolved in Lemmy, but the Lemmy brand is permanently tainted among users who are looking for alternatives to American oligarchic technology services. The low moral standards of the Lemmy devs' (support for the brutal North Korean regime, promotion of russian propaganda narratives that they know are false) is a massive turn off for the exact target market of the Fediverse. It's a fact that many Europeans looking for alternatives instinctively recognize the demagoguery of the Lemmy devs and their fans.

    I don't think this is true at all.

    The average user doesn't know what Lemmy is, let alone the political views of their core development team.

    But don't worry, it's like that joke about vegans:

    How do you know the Lemmy devs are politically dubious? Don't worry, someone on the threadiverse will tell you.

    read more

  • How the links act is different from client to client. If you click the link in the Lemmy web UI, it will take you directly to Lemmy.wtf, but if you used Voyager (iOS client), it will automatically redirect to your own instance.

    This is something that should be built into the Lemmy web UI.

    You can also use browser addons. I have an addon that redirects me to my own instance, if I click on a link in my browser. I also have an addon that takes me from YouTube to Peertube, if the video also exist in PeerTube or if I click a PeerTube link, it takes me to my instance.

    Also how dare you criticise the awesome TLD .wtf, which is clearly an abbreviation of “What The Fediverse”?!

    read more

  • I've seen that being used. It works fine for more technical users, but it's just an extra pain point.

    If you make links, you need to apply the service Different UI from whatever instance/client/platform that you are using.

    I much prefer Piefed's soon to be released link substitution feature.

    read more

  • Mbin has had that feature for a while too

    read more

  • It's a temporary workaround but the experience is still clunky

    read more

  • Well; atleast for lemmy, there's https://lemmyverse.link/ ; which fixes exactly what you mention. You send that link, other people choose their instance in the redirect, and boom!

    read more
Post suggeriti
  • ⏳ Just a few hours left!

    Fediverso fediverse
    1
    0 Votes
    1 Posts
    4 Views
    ⏳ Just a few hours left! 🔥We're in the final stretch of the Bonfire crowdfund. Help unlock new features for community-run spaces in the #fediverse! Every share or contribution makes a real difference.Support or boost before time runs out:https://www.indiegogo.com/projects/bonfire/community?refcode=KSZZAOGLZ028Aw6GI1ZvVQRead about our groups stretch goal, to bring genuine community spaces to the fediverse:https://bonfirenetworks.org/posts/why-community-matters-groups-as-the-next-step-for-the-fediverse/Endless thanks to everyone who supported us already! Let’s show what open and caring federated networks can achieve! 💜🌱
  • 0 Votes
    1 Posts
    11 Views
    I hate to glaze anything too much... but Fosstodon is pretty cool, I'd say. If you moved instances during the troubles you should really consider making your way back home! Miss u <3#Mastodon #Fosstodon #Fediverse #ActivityPub
  • 0 Votes
    3 Posts
    27 Views
    @acirep 🤣I couldn't even decide which movie I wanted to watch
  • 0 Votes
    1 Posts
    7 Views
    Threads, la nueva red social de Meta, será compatible con el Fediverso. ¿Es esto una buena noticia? La historia parece indicar que no, ya que es probable que la multinacional esté desplegando una estrategia llamada "Adopta, Extiende, Extingue".. Las grandes compañías tech, las que están incluídas en las siglas GAFAM, esto es, Google, Apple, Facebook, Amazon y Microsoft, son conocidas por sus supuestas (o a veces no tan supuestas) prácticas monopolísticas. Solo a modo de ejemplo, una rápida búsqueda en internet nos proporciona casos como: - El departamento de justicia contra google. - La FTC contra Facebook. - Y otros casos similares de los estados de Tejas, Colorado y Utah contra google. No obstante, Meta (ose podría enfrentar hoy en día a un competidor que no puede ser comprado: el Fediverso. En el vídeo anterior os introduje un poco a este mundo del fediverso. El fediverso es un grupo descentralizado de servidores que usan el protocolo ActivityPub para comunicarse entre ellos. ActivityPub es un protocolo de red abierto para crear redes sociales descentralizadas. Básicamente, este protocolo proporciona una API cliente-servidor para crear, actualizar y eliminar contenidos, así como una API federada de servidor a servidor para enviar notificaciones y contenidos. El resultado es que con este protocolo se han creado redes sociales federadas y descentralizadas, como Mastodon (que sería como un Twitter), PeerTube (que sería como un Youtube), Lemmy (que sería como un Reddit), y otras. De los enormes beneficios que aportan estas redes descentralizadas, federadas, y FOSS, ya hablé en mi vídeo anterior. La idea de este vídeo es ver los mecanismos que tienen las grandes tecnológicas para acabar con esta competencia, que no pueden comprar como ha hecho en otras ocasiones, ya que no es propiedad de nadie, sino el resultado de la comunicación espontánea entre muchos servidores. 🕒 Marcas temporales: 00:00 Introducción 00:26 El Fediverso como amenaza 02:48 "Adopta, Extiende, Extingue" 04:32 Google vs XMPP 12:27 El origen de la estrategia 14:44 Meta vs Fediverso 15:50 La prueba 16:16 Conclusión: ¿qué podemos hacer? 🔵 Algunos enlaces relevantes: 🔗 Artículo en que me he basado: https://ploum.net/2023-06-23-how-to-kill-decentralised-networks.html 🔗 Casos judiciales GAFAM: https://www.economicliberties.us/tech-lawsuit-timelines/ 🔗 Threads: https://www.xataka.com/basics/threads-instagram-que-como-funciona-que-promete-esta-red-social 🔗 Fediverso: https://fediverse.party/ 🔴 VÍDEOS QUE YOUTUBE NO TE RECOMIENDA https://youtu.be/EQy9g-U0VYM https://youtu.be/tzkb-qH-uYU 🟢 CONTRIBUYE A LA DIFUSIÓN DEL SOFTWARE LIBRE: 🦇 Donando BAT si usas Brave Browser 🪙 Bitcoin (BTC): bc1qtmpr2k40kquq6scchv9dre65lahjr2gxrpdp69 🌩️ Bitcoin lightning (BTC): https://getalby.com/p/linuxchad 🕵️ Monero (XMR): 86LXrzSe7wfLAsWVftebH3UNozb6Pf5K8KKooBRo47BYhge4HmzEeaBHa3twGe3hmjG5UPUm6DrFhi2tZVPnaxm752vhZ9f