Open4

手動ActivityPub

okuokuokuoku

WebFinger

どちらも同じ内容が取れる。

{
  "subject": "acct:okuokutest@misskey.io",
  "links": [
    {
      "rel": "self",
      "type": "application/activity+json",
      "href": "https://misskey.io/users/9czxp5d7tk"
    },
    {
      "rel": "http://webfinger.net/rel/profile-page",
      "type": "text/html",
      "href": "https://misskey.io/@okuokutest"
    },
    {
      "rel": "http://ostatus.org/schema/1.0/subscribe",
      "template": "https://misskey.io/authorize-follow?acct={uri}"
    }
  ]
}

普通だな。 https://misskey.io/users/9czxp5d7tk がActorのURLになる。

okuokuokuoku

Actorオブジェクトの取得

$ curl --header "Accept: application/activity+json" https://misskey.io/users/9czxp5d7tk | jq .

Curlで拾ってくる。pretty-printは jq で適当に。。仕様としては Accept ヘッダは application/ld+json; profile="https://www.w3.org/ns/activitystreams" らしい(MUST)。

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
      "sensitive": "as:sensitive",
      "Hashtag": "as:Hashtag",
      "quoteUrl": "as:quoteUrl",
      "toot": "http://joinmastodon.org/ns#",
      "Emoji": "toot:Emoji",
      "featured": "toot:featured",
      "discoverable": "toot:discoverable",
      "schema": "http://schema.org#",
      "PropertyValue": "schema:PropertyValue",
      "value": "schema:value",
      "misskey": "https://misskey-hub.net/ns#",
      "_misskey_content": "misskey:_misskey_content",
      "_misskey_quote": "misskey:_misskey_quote",
      "_misskey_reaction": "misskey:_misskey_reaction",
      "_misskey_votes": "misskey:_misskey_votes",
      "isCat": "misskey:isCat",
      "vcard": "http://www.w3.org/2006/vcard/ns#"
    }
  ],
  "type": "Person",
  "id": "https://misskey.io/users/9czxp5d7tk",
  "inbox": "https://misskey.io/users/9czxp5d7tk/inbox",
  "outbox": "https://misskey.io/users/9czxp5d7tk/outbox",
  "followers": "https://misskey.io/users/9czxp5d7tk/followers",
  "following": "https://misskey.io/users/9czxp5d7tk/following",
  "featured": "https://misskey.io/users/9czxp5d7tk/collections/featured",
  "sharedInbox": "https://misskey.io/inbox",
  "endpoints": {
    "sharedInbox": "https://misskey.io/inbox"
  },
  "url": "https://misskey.io/@okuokutest",
  "preferredUsername": "okuokutest",
  "name": "okuoku (Test)",
  "summary": "<p><span>本家: </span><a href=\"https://misskey.io/@okuoku\" class=\"u-url mention\">@okuoku</a></p>",
  "icon": {
    "type": "Image",
    "url": "https://s3.arkjp.net/misskey/be0f055c-1dca-435d-b0fb-cbf442452f28.png",
    "sensitive": false,
    "name": null
  },
  "image": null,
  "tag": [],
  "manuallyApprovesFollowers": false,
  "discoverable": true,
  "publicKey": {
    "id": "https://misskey.io/users/9czxp5d7tk#main-key",
    "type": "Key",
    "owner": "https://misskey.io/users/9czxp5d7tk",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkdi2UOk7gqoA0a1aUPjp\nKoyqBTAiFniWZFI1HwA8TZNB1PlVgg9tf8tKCCPsBwo+uySv0lM12AL9dyO67uR1\nO6Q/suN11WRNFs7wFi7BDypYA63oZys2L8twiTRkSuqNmigW8gWsVobcJ9Ab88XM\nShGAlML9Z2eIaThEYNOE4biXla5HAXT+DkOyFcfKGiH3NOq2/m8Owa0ejmgh7YD3\nBeQjqbHcoQ05snpqYJ/fbQM7JvMsArdeaqqw9aMourzNdEdp5wnVE+MvGFcBhAMP\nh3DKtBZcfxjLXxbozrhv/7KKSiC8MUyKBOQkpHwbSKRuKomxZ2SQ86w32I7Zbbhd\ndP2v4nPCRZvgVfIMmwXVYWQTjFfbGB5+jxNzqyWyYNwb2k8WnPK6On6BaAxPNkzI\nJFf/SQAU0td1WY4uB7+zJxy43whkdLYixX/V61oodYpwXy2fkdLs2iQsTIJl6ZMt\nMEixPC+rksB6J8wN0tfn8wsKWEAn21cflZHz/jNyJf23y6saQdSt09rsOHYJueQb\newevMS7rHNxECe6iUzHVYHn2sNmlHhdGa59fkO0e+6McTGRSPIpAEGPY6kpHmfQq\nTe4s2nlNNQFx77DWwXJg7onyq8SFm/tDbHPJ696eSBzUYMm6DdiDLXyW9/fdTtXI\nJPkdsfEill11E/SYezxu0f0CAwEAAQ==\n-----END PUBLIC KEY-----\n"
  },
  "isCat": false,
  "vcard:Address": "Tokyo"
}

Outboxは https://misskey.io/users/9czxp5d7tk/outbox にあることがわかる。

okuokuokuoku

ノートの取得

Outboxは OrderedCollection なので、 https://misskey.io/users/9czxp5d7tk/outboxapplication/activity+jsonGET して得られるのは:

{
...
  "id": "https://misskey.io/users/9czxp5d7tk/outbox",
  "type": "OrderedCollection",
  "totalItems": 1,
  "first": "https://misskey.io/users/9czxp5d7tk/outbox?page=true",
  "last": "https://misskey.io/users/9czxp5d7tk/outbox?page=true&since_id=000000000000000000000000"
}

first のURLを拾うと:

{
...
  "id": "https://misskey.io/users/9czxp5d7tk/outbox?page=true",
  "partOf": "https://misskey.io/users/9czxp5d7tk/outbox",
  "type": "OrderedCollectionPage",
  "totalItems": 1,
  "orderedItems": [
    {
      "id": "https://misskey.io/notes/9d07zaq7bm/activity",
      "actor": "https://misskey.io/users/9czxp5d7tk",
      "type": "Create",
      "published": "2023-03-31T14:44:11.407Z",
      "object": {
        "id": "https://misskey.io/notes/9d07zaq7bm",
        "type": "Note",
        "attributedTo": "https://misskey.io/users/9czxp5d7tk",
        "content": "<p><span>test</span></p>",
        "_misskey_content": "test",
        "source": {
          "content": "test",
          "mediaType": "text/x.misskeymarkdown"
        },
        "published": "2023-03-31T14:44:11.407Z",
        "to": [
          "https://www.w3.org/ns/activitystreams#Public"
        ],
        "cc": [
          "https://misskey.io/users/9czxp5d7tk/followers"
        ],
        "inReplyTo": null,
        "attachment": [],
        "sensitive": false,
        "tag": []
      },
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "cc": [
        "https://misskey.io/users/9czxp5d7tk/followers"
      ]
    }
  ],
  "prev": "https://misskey.io/users/9czxp5d7tk/outbox?page=true&since_id=9d07zaq7bm",
  "next": "https://misskey.io/users/9czxp5d7tk/outbox?page=true&until_id=9d07zaq7bm"
}

え" reactionsは付いてこないの。。?