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?

    • julian@activitypub.space
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      4 hours ago

      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.