Skip to content

w3c-social/Social-APIs-Brainstorming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

W3C Social Web WG Brainstorming

This repo is a collection of resources related to ongoing development of Social and Federation API specificaitons, according to the SocialWG charter.

Table of contents

Brainstorming

Common Ground

Bearer tokens

  • Bearer tokens for authentication
  • Leave obtaining the bearer token out of the spec, since there are already several RFCs for ways to obtain bearer tokens

Endpoints

Similar but different:

Read content Publish content Receive notifications
ActivityPump GET /outbox POST to /outbox GET /inbox
Micropub n/a; GET homepage (or feed URL) assumed to be marked up with microformats2 discover micropub endpoint (rel="micropub") and POST to it receive webmention at discoverable rel="webmention" endpoint; how to handle not spec'd
SoLiD GET container or resource URI POST to URI of a Container ?

Issues

  • Vocabulary - h-entry and h-card vs ActivityStreams 2.0 content types
  • author in microformats vs actor and attributedTo in AS
  • url and uid in microformats vs url, @id and href in AS

Micropub

Things ActivityPump does that Micropub wants

  • Audience targeting for private content ("to")
  • Propagating state changes (e.g. an "update" of an object needs to propagate to consumers)
  • Collections - managing the "following" collection vs the "posts" collection

Ideas

  • Generating "activity" posts after manipulating content posts
  • Or attaching all metadata to the 'object' and sending pure objects (that still look like activities) for publishing and distribution as JSON.

Example of Micropub requests posted as JSON

** Expansion upon these at http://rhiaro.co.uk/2015/05/micropubbing-with **

Creating a Post

Creating a post, specifying properties from the microformats2 vocab. The type and properties map to the output of the Microformats 2 parsed result.

Form-encoded requests have a property h=* which specifies the type of object being created. All other properties are considered properties of the object being created.

h=entry&
content=hello+moon&
category[]=indieweb&
category[]=micropub

When submitting a request in JSON format, simply send the JSON-encoded representation of the Microformats2 object you are creating. Properties such as author and publish date are set by the Micropub endpoint if not specified in the request.

{
  "type": ["h-entry"],
  "properties": {
    "content": ["hello moon"],
    "category": ["indieweb","micropub"]
  }
}

Editing a post

Because of the nuances of modifying specific values in properties, these requests do not have a "simple" form-encoded representation, and must use nested properties with array notation. These form-encoded requests are the same structure as the JSON version, but serialized as form-encoded instead.

Replacing all values of a property

Updating a specific property of a post, replacing all values of the property. If the property does not exist already, it is created.

edit-of=http://example.com/post/1
&update[properties][content]=hello+moon
{
  "edit-of": "http://example.com/post/1",
  "update": {
    "properties": {
      "content": ["hello moon"]
    }
  }
}
Adding a value to a property

Adding a value. If there are any existing values for this property, they are not changed, the new values are added. If the property does not exist already, it is created.

edit-of=http://example.com/post/1
&add[properties][category][]=indieweb
&add[properties][category][]=foo
{
  "edit-of": "http://example.com/post/1",
  "add": {
    "properties": {
      "category": ["indieweb","foo"]
    }
  }
}
Removing a value from a property

Removing a value. This removes just the "indieweb" value from the "category" property, leaving all other values. If no values remain, the property is removed.

edit-of=http://example.com/post/1
&remove[properties][category]=indieweb
{
  "edit-of": "http://example.com/post/1",
  "delete": {
    "properties": {
      "category": ["indieweb"]
    }
  }
}
Removing a property
edit-of=http://example.com/post/1
&remove[properties]=indieweb
{
  "edit-of": "http://example.com/post/1",
  "delete": {
    "properties": ["category"]
  }
}

Deleting a post

delete-of=http://example.com/post/1
{
  "delete-of": "http://example.com/post/1"
}

ActivityPump

Things that Micropub does that ActivityPump wants

  • Ability to get source of post (e.g. original markdown posted in)
  • Uploading multiple files
  • Split up specification into more manageable chunks and not be one huge daunting spec

Minimum viable create request

The minimum allowed in the spec is:

{
    "@context": "http://www.w3.org/ns/activitystreams",
    "@type": "Create",
    "object": {
        "@type": "Note",
        "content": "Hello world!"
    }
}

If we had it so that an activity could be created as a side effect:

{
    "@context": "http://www.w3.org/ns/activitystreams",
    "@type": "Note",
    "content": "Hello world!"
}

This as a side-effect would not only create the note but also create an activity.

Notes

  • In ActivityPump, following someone results in seeing everything they post directed to their followers
  • "quiet posting" in AP doesn't exist, e.g. you can't make something public and not have it pushed to everyone-

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published