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
  • 1 Votes
    1 Posts
    13 Views
    RE: https://mastodon.social/@MastodonEngineering/115337952873418574Uy... πŸ‘€ Interesante...> Change the identifiers used in ActivityPub to numeric IDs (instead of their username) for new users. This is a first step towards allowing account renaming. β€” Github PR #32724 (by ClearlyClaire)#mastodon #activitypub #fediverso #fedi #fediverse
  • 0 Votes
    1 Posts
    12 Views
    I understand we have some new #Bluesky refugees here in the #fediverse. Remember to boost and share, the Fediverse is made of people, not exploitive algorithms! Welcome! Intro time:I’m Kevin, been building professional #puppets since 2019. I make videos and tutorials, live #stream, a #podcast, and even do some occasional not-puppet tech and #gaming stuff. All links at https://www.operationpuppet.com. Also an old goth, but you might have guessed that from these examples of my more recent work.
  • 0 Votes
    1 Posts
    11 Views
    Hello #Fediverse and Happy New Year!I'd like to mark the start of 2025 with the first message from my self-hosted instance. You may already know me as @_elena@mastodon.social. Well, now I also run my own #ActivityPub microblogging server, thanks to the magic of #YunoHost and #GoToSocial (and #Phanpy, which I'm using to compose this).I registered this domain – aseachange.com – a looooong time ago but never did anything with it. It was the very first domain name I ever bought, even before securing elenarossini.com (!!!). It was so long ago, but I remember I was inspired by Beck's album Sea Change. seachange[dot]com was taken, so I grabbed Aseachange.I absolutely love its meaning of profound transformation and I think it's PERFECT for my self-hosted #Fediverse instance and what it represents: independence, empowerment and digital sovereignty.Ever since setting it up, I've been feeling joyful and hopeful. Everytime I look at myself in the mirror, I think: I'm in control of my own social media platform. And it feels SOOO GOOD.What do I have in store for 2025? I plan to use this account to post messages about #selfhosting, learning #Linux, privacy and digital sovereignty.I will also keep posting from my Mastodon account because you don't give a Lamborghini to someone who just passed their driver's license. I barely know what I'm doing here, so I feel a lot safer (for now) keeping my mastodon.social account as well... In case anything goes wrong here. Better safe than sorry!So, this is my #Introduction and if you've read as far as here I just want to thank the Fediverse for being so amazing and allowing me to connect with people on my own terms. And thank you Fedi people for being so generous and supportive with your superb advice and kind words.This is a really magical, special place.Happy New Year, everyone!
  • 0 Votes
    1 Posts
    4 Views
    It's time for an #introduction.I'm glad to meet you! I'm the barista and main administrator of the bsd.cafe and illumos.cafe instances (and other projects), a computer science enthusiast who's been fascinated by technology since childhood. I'm a big supporter of open-source solutions and enjoy working with #BSDs as well as #illumos based OSes and #Linux systems. I enjoy #music and #photography. I've been an avid traveler and am now looking forward to getting back to traveling.I'm married to a wonderful wife and strive to live each day with a positive attitude,making the most of every day to improve our lives.I like writing blog articles, especially tech ones (https://it-notes.dragas.net) and, from time to time, some of them are widely appreciated, especially in the open-source community.Thank you for passing by and reading my introduction, enjoy your stay here in the #fediverse