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 64
  • 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
  • Now this is a good reason to move a community to a different region.

    read more

  • As a US-based person, just no. It is not desirable to host anything here or to trust any US-based service for a number of reasons.

    read more

  • If we look at how toxic and racist the local city groups are on Reddit or Facebook, I'm not sure this is a good model. If I'm a black trans woman living in a small town in Mississippi, my local instance might not even be a safe place, for me.

    Similarly, I would encourage blind folks to join us at rblind.com rather than a local instance, because a local instance might not take our needs into account: many have captchas, some use inaccessible themes, etc. At rblind.com you can be sure that we won't deploy an update or configuration change that will break accessibility, because the server admins and moderators are all blind ourselves. But the beauty of federation means that you can talk to everyone else on other instances, so being part of a particular identity group doesn't limit you to just talking to other members of that group.

    read more

  • To counter my own argument, that's partly because that instance is less likely to go away or suffer downtime than one run by a single person and with 10 active users. It's partly why I signed up to it (also because nobody was telling me to do otherwise).

    read more

  • I'm sorry, this is not how federation works, and if it were truly as limited as "one activity at a time", moving a community to an entirely different continent is a fantastically short sighted idea.

    Moving geographically closer to something else is important if you need real-time savings (e.g. high frequency trading, scientific research). ActivityPub is an asynchronous communications protocol built upon technology with decent if occasionally dubious reliability. Doing something this drastic to shave off ~100ms is not correct.

    read more

  • Agreed. And it's not a zero-sum game.

    The fact I'm on english speaking fediverse doesn't mean I'm not on the finnish speaking fediverse.

    And what instance I'm on has absolutely no bearing on which one I spend my time.

    read more

  • Due to the rate of federation being limited by latency, instances have actually been re-locating to mostly Europe, so they can more easily keep up with each other.

    Any examples for that? Latency causing instances not being able to keep up with federation is new to me.

    read more

  • It's frustrating to see the largest instance recommended all the time since it's rather heavy on censorship

    read more
Post suggeriti
  • 0 Votes
    1 Posts
    9 Views
    Niagara.social is a Mastodon Hometown server based in the Niagara region in Ontario, Canada.This server has a post size of up to 1500 characters. https://niagara.socialYou can find out more at https://niagara.social/about or contact the admin account @admin #FeaturedServer #Niagara #Ontario #Canada #Mastodon #HometownMastodon #Fediverse #FreeFediverse
  • 0 Votes
    6 Posts
    13 Views
    In general that's a good idea because you should never trust content coming from somewhere else (even in an S2S context) For reference, NodeBB literally sanitizes the bejeezus out of what it gets from anywhere. All classes are removed, all attributes are removed. I want it as close to semantic HTML as possible, and classes/attributes mean absolutely nothing because: I don't use the same CSS classes Attributes may not follow my own rules for when and where they are added. For example, Mastodon messes with any URL it federates out. It chops the anchor text in half, hides the rest behind invisible or something, and adds an ellipsis. invisible does something different in NodeBB, so there is a CSS conflict here. I strip everything and just show the URL as it was intended.
  • 0 Votes
    4 Posts
    16 Views
    @mike @matt @_elena I said that same thing when I got on stage (after her!). I'm not sure I was a good follow-up act... 😜
  • 0 Votes
    11 Posts
    52 Views
    @evan @phi > We have some ad hoc ways to move from one to the other, but they aren't built into the SMTP or IMAP specsyes they are, though? in IMAP, you can just copy your messages and folders from one inbox to another. in SMTP, we have email forwarding.using your own DNS name can make things easier, but the main challenge in fedi is that we don't have a common storage/access abstraction (equivalent to IMAP folders), and we don't recognize HTTP redirects (equivalent to SMTP forwarding).