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
  • 0 Votes
    1 Posts
    7 Views
    Wäre es nicht super, wenn man sich mit sei­nem Mast­o­don-Account ein­fach für eine Ver­an­stal­tung anmel­den könn­te – so wie das frü­her bei Face­book mög­lich war? Der­zeit geht das noch nicht. Aber es gibt ein paar hoff­nungs­vol­le Anzei­chen, dass sich das ändern könnte.Ich habe es im letz­ten Arti­kel ange­teasert: In der Sprech­stun­de hat André Men­rath (@linos) ein paar inter­es­san­te Din­ge erzählt und wir haben uns über die gene­rel­le Situa­ti­on von Ver­an­stal­tun­gen bei Word­Press und im Fedi­ver­se unterhalten. Bei Plug­ins für Ver­an­stal­tungs-Kalen­der bin ich wirk­lich kri­tisch. Ich habe damals das Ein­ga­be­for­mu­lar für den Ver­an­stal­tungs­ka­len­der bei kiel4kiel.de ent­wi­ckelt. Wenn man jeden Monat 1000 Ter­mi­ne ein­ge­ben will, sieht man zu, dass man da kei­nen ein­zi­gen Klick zu viel macht, weil das immer x1000 geht.Ich habe noch kein For­mu­lar für Ver­an­stal­tun­gen gese­hen, das so prak­tisch war, wie unser User-Inter­face damals. Das fängt damit an, dass Ver­an­stal­tun­gen NIE um 00:00 Uhr anfan­gen. Die Zeit­aus­wahl steht aber bei jeder Soft­ware auf 00:00 und die­ser Stan­dard­wert lässt sich nicht konfigurieren.Events bei WordPressIch bin der Mei­nung, dass es kein ein­zi­ges gutes Event-Plug­in für Word­Press gibt. Auch kein kom­mer­zi­el­les. Ich ken­ne kei­nes. Die meis­ten sind mit Fea­tures total über­la­den, die dafür auch noch schlecht zu bedie­nen sind. Dazu kommt, dass alle Kalen­der schei­ße aus­se­hen und man sie nicht anpas­sen kann – selbst wenn sie sich ein eige­nes Tem­p­la­te-Sys­tem über­legt haben.Beim Web­Mon­tag brau­che ich ein ein­fa­ches Plug­in bei dem man Datum und Uhr­zeit und eine Adres­se ein­gibt. Außer­dem soll man sich an- und abmel­den kön­nen. Ich habe das vor lan­ger Zeit über einen Cus­tom-Post-Type erle­digt, den ich um Datum und Loca­ti­on erwei­tert habe. Außer­dem habe ich die Kom­men­tar­funk­ti­on dort so „gehackt“, dass das Text­feld aus­ge­blen­det wird. So mel­det man sich an, indem man einen Kom­men­tar ohne Text abgibt. Des­we­gen bekommt man auch kei­ne Benach­rich­ti­gung und man kann sich auch dar­über nicht abmelden. Das funk­tio­niert. Aber ich hät­te trotz­dem eine etwas kom­for­ta­ble­re Lösung. Bei Gather­Press arbei­ten wohl gera­de eini­ge moti­vier­te Ent­wick­ler an einem neu­en Plug­in für Events. Das sieht auf den ers­ten Blick sehr auf­ge­räumt aus und scheint sich an den moder­nen Para­dig­men der Word­Press-Ent­wick­lung zu orientieren.Events im FediverseAuch im Fedi­ver­se gibt es Ver­an­stal­tun­gen. Mobi­li­zon ist eine Lösung dafür. Auf so einer Instanz gibt es dann nur Ver­an­stal­tun­gen. Ich ken­ne mich damit nicht so gut aus. Aber super wäre es natür­lich, wenn ich einem Account bei Mobi­li­zon bspw. von Mast­o­don aus fol­gen könn­te und wenn mir dann eine Ver­an­stal­tung durch die Time­line läuft, kli­cke ich auf „teil­neh­men“ und bin ange­mel­det. Das geht aber noch nicht. Es gibt aber wohl Über­le­gun­gen bei Mast­o­don, Ver­an­stal­tun­gen bes­ser zu unter­stüt­zen. Fri­en­di­ca, Hub­zil­la und Ple­ro­ma kön­nen das schon – zumin­dest teilweise.Auf der Sei­te von Word­Press arbei­ten And­re Men­rath und Mat­thi­as Pfef­fer­le (@pfefferle) an einer Bridge für die bestehen­den Event-Plug­ins ins Fediverse.Die­se The­ma ist lei­der noch nicht ganz so kon­kret wie die grund­sätz­li­che Unter­stüt­zung für Arti­kel von Word­Press in Mast­o­don. Es sind eini­ge Puz­zle­tei­le, die ein inter­es­san­tes Bild ver­spre­chen, wenn sie jemand klug zusammensetzt. Ich fänd es cool, wenn ich eine Lösung hät­te bei der Men­schen den Ver­an­stal­tun­gen des Web­Mon­tags bspw. auf Mast­o­don fol­gen und sich anmel­den könn­ten. Zusätz­lich wäre es aber natür­lich nötig, dass man sich auch wei­ter­hin unkom­pli­ziert ohne Account anmel­den könn­te. Ein Ter­min-Plug­in, bei dem ich eine Stan­dard-Start­zeit ein­stel­len kann, weil der Web­Mon­tag immer ab 19 Uhr sei­ne Tür öff­net; einen Stan­dard-Ver­an­stal­tungs­ort, weil wir meis­tens in der Star­ter­kit­chen sind. Eine öffent­lich ein­seh­ba­re Teil­nah­me­lis­te, aus der sich Leu­te auch auf Wunsch aus­blen­den kön­nen und die sich nach ein paar Mona­ten von allei­ne löscht und nur die zusam­men gerech­ne­te Zahl der Anmel­dun­gen behält.Dar­auf muss ich wohl noch ein wenig war­ten. Aber Vor­freu­de ist ja auch etwas Schönes.
  • 0 Votes
    6 Posts
    11 Views
    Yeah definitely keep at it with the Wordpress plugin. obenland@mastodon.social and pfefferle@mastodon.social are working hard on it and improving it all the time! If it didn't work for you before it could very well be a completely different experience the next time around. johentsch@hostux.social
  • 0 Votes
    1 Posts
    13 Views
    The pizza was good and now it's time to go to bed. Ready for a new week. Ready for a new Monday.Goodnight, #FediverseGoodnight, world!
  • 0 Votes
    17 Posts
    83 Views
    incentive@mastodon.circlewithadot.net incentive welcome!