Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML to ActivityPub: Consider HTML values of summary/content within AS2 objects #37

Open
trwnh opened this issue Nov 16, 2024 · 2 comments

Comments

@trwnh
Copy link

trwnh commented Nov 16, 2024

One user story says:

As a social network client user, when I see a link in the content of a social media post, I want to load the resource for that link into my social media client without launching an external browser, so that I have a smooth user experience and can fully interact with the content. Given a link like https://html.example/blog/page-1.html, an ActivityPub API client could discover the related ActivityPub ID https://ap.example/api/page-1.jsonld, retrieve it with machine-readable metadata, and provide affordances for interacting with the object, such as liking, sharing, or replying.

For this user story, it is necessary to consider not just HTML documents but also HTML strings within AS2 objects.

I think 2.2.2 https://swicg.github.io/activitypub-html-discovery/#html-a-element should contain a further example and consideration for marking up HTML values within an AS2 object along the same lines:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://ap.example/api/notes/note-9999.jsonld",
  "content": "Check out <a href=\"https://ap.example/api/notes/note-9998.jsonld\" type=\"application/activity+json\">my previous note</a>"
}
@evanp
Copy link
Collaborator

evanp commented Nov 18, 2024

I don't understand this. Won't most systems create links to HTML documents rather than to JSON-LD objects?

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://ap.example/api/notes/note-9999.jsonld",
  "content": "Check out <a href=\"https://html.example/pages/note-9998.html\">my previous note</a>"
}

The steps here, when the user clicks that link in their social network client:

  1. Discover the ActivityPub ID of the resource represented by the URL. (If none exists, follow the link as normal.)
  2. Fetch the ActivityPub representation from the ID (using, say, proxyUrl, or just making an HTTP request).
  3. Showing the ActivityPub object in the social network client. All the social client affordances such as like, reply, share, and so on are built right in.

@trwnh
Copy link
Author

trwnh commented Nov 19, 2024

Oops, I copied the wrong example as my basis. Here's one that probably makes more sense:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://mixed.example/api/notes/note-9999",
  "content": "Check out <a href=\"https://mixed.example/api/notes/note-9998\" type=\"application/activity+json\">my previous note</a>"
}

The intent of this issue is to handle links to objects ("object links") i.e. signaling that content negotiation should work. This is in keeping with the user story of "not leaving the client", but without having to pass through intermediary HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants