まず取得するにはちょっとクセがある
- 該当ユーザーがオプトインしてる必要がある
- GETに署名を付ける必要がある (MisskeyでもMastodonでもデフォルトで有効なはず)
- この場合外部からこちらの署名を取得しに来てもらう必要があるため、必然的にインターネットに公開されたサーバーからでないとリクエストできないと思われる。
- AP対応 (2023/3/22) より前の投稿はおそらく取得できない
- なんか429を返されることがある。(URLプレビューとかでFacebookとかインスタのプレビュー要求しまっくってるとFacebook系のNWからブロックされる?上記前提条件を満たしてないと非AP要求とみなされてレートでブロックされる?)
- それでもなんか取得できない環境もある?
@[email protected]
さんのアカウントをサンプルにさせてもらったわ。
比較的普通、Userを特定するidにusernameを含めずにDB idを使用するあたりはMisskeyタイプ。
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1"
],
"id": "https://threads.net/ap/users/17841464812043266/",
"type": "Person",
"name": "gihyo.jp",
"preferredUsername": "gihyojp",
"summary": "<p>gihyo.jpの掲載記事を取り上げていきます。<br />「フェディバースへのシェア」有効済みです。 「@[email protected]」を検索してください。</p>",
"url": "https://threads.net/@gihyojp/",
"inbox": "https://threads.net/ap/users/17841464812043266/inbox/",
"outbox": "https://threads.net/ap/users/17841464812043266/outbox/",
"followers": "https://threads.net/ap/users/17841464812043266/followers/",
"following": "https://threads.net/ap/users/17841464812043266/following/",
"endpoints": {
"sharedInbox": "https://threads.net/ap/inbox/"
},
"publicKey": {
"id": "https://threads.net/ap/users/17841464812043266/#main-key",
"owner": "https://threads.net/ap/users/17841464812043266/",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2e06DiyhnSiqMsXW0n69\nRbyhCEZBDvxg/H/I1UKGsFF/Z4WT5FaJnm2geouDOXk7BFoVm2qR45UgtWrtKNy7\n+GEVxK1z6ouG0L6Qq6IY+JM9K2IQofEWCj9ZU3EVvfg7FGNeUWzg0ZQf3bmHjd+V\n8hmKzTRyLCl4fP3OgPLlnfMZuK4r2yUMCb5FqtEkm0QtIIlQLrer6tGNRK8h1BZf\no0SdWrBBAb3Di7I/Z1cx/E3K0Padj6rjYCX68b0MSjb3raTYiPT+fGvOvKus2I4k\nXFcioqMQ1uTo4y1NM8f5A2sXVc1QeprFw90YH5enfC6ocFwce5Aa4tHbHcJWMjWD\noQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"url": "https://scontent-nrt1-2.cdninstagram.com/v/t51.2885-19/427871820_899150492214119_7006948955941929111_n.jpg?stp=dst-jpg_s400x400&_nc_cat=104&ccb=1-7&_nc_sid=3fd06f&_nc_ohc=jOwWA0bdzrYAX9sLRqs&_nc_ht=scontent-nrt1-2.cdninstagram.com&oh=00_AfBItP9unYvVJzDWnw14QEL1yfn9WfSuY_9Y-AuDuyD0QQ&oe=66031C74"
}
}
存在していてOrderedCollectionを返すけど、~Pageはないので取得できるのは投稿数くらいで投稿の一覧は取得できない。
{
"@context": [
"https://www.w3.org/ns/activitystreams"
],
"id": "https://threads.net/ap/users/17841464812043266/outbox/",
"type": "OrderedCollection",
"totalItems": 51
}
なお、followers, following なコレクションも同様。
とても普通
{
"@context": [
"https://www.w3.org/ns/activitystreams"
],
"id": "https://threads.net/ap/users/17841464812043266/post/18146528611310935/",
"type": "Note",
"content": "<p>ニュース「Threadsがfediverseへの統合機能をベータ版として提供開始 ―Mastodon、Misskeyなどと投稿共有可能に」公開<br /><a href=\"https://gihyo.jp/article/2024/03/threads-fediverse\" target=\"_blank\" data-lnfb-mode=\"ie\">https://gihyo.jp/article/2024/03/threads-fediverse</a></p>",
"published": "2024-03-21T19:15:01-07:00",
"attributedTo": "https://threads.net/ap/users/17841464812043266/",
"url": "https://www.threads.net/@gihyojp/post/C4zKUqhvoPm",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://threads.net/ap/users/17841464812043266/followers/"
],
"tag": []
}
現時点では"url": "https://www.threads.net/@gihyojp/post/C4zKUqhvoPm"
の方をリクエストしても取得できない。
"id": "https://threads.net/ap/users/17841464812043266/post/18146528611310935/"
の方を使う必要がある。
AP対応 (2023/3/22) 以前の投稿も取得出来ないかも。
Activityでwrapされたエンドポイントもあるらしい
ちゃんとActivityとObject両方にto, cc
付いてる
{
"@context": [
"https://www.w3.org/ns/activitystreams"
],
"id": "https://threads.net/ap/users/17841464812043266/post/18146528611310935/activity/",
"type": "Create",
"object": {
"id": "https://threads.net/ap/users/17841464812043266/post/18146528611310935/",
"type": "Note",
"content": "<p>ニュース「Threadsがfediverseへの統合機能をベータ版として提供開始 ―Mastodon、Misskeyなどと投稿共有可能に」公開<br /><a href=\"https://gihyo.jp/article/2024/03/threads-fediverse\" target=\"_blank\" data-lnfb-mode=\"ie\">https://gihyo.jp/article/2024/03/threads-fediverse</a></p>",
"published": "2024-03-21T19:15:01-07:00",
"attributedTo": "https://threads.net/ap/users/17841464812043266/",
"url": "https://www.threads.net/@gihyojp/post/C4zKUqhvoPm",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://threads.net/ap/users/17841464812043266/followers/"
],
"tag": []
},
"actor": "https://threads.net/ap/users/17841464812043266/",
"published": "2024-03-21T19:15:01-07:00",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://threads.net/ap/users/17841464812043266/followers/"
]
}
なんと_misskey_quote
で引用が実装されている
また、tagの方のLinkはFEP-e232
によるものらしい
https://codeberg.org/fediverse/fep/src/branch/main/fep/e232/fep-e232.md
https://engineering.fb.com/2024/03/21/networking-traffic/threads-has-entered-the-fediverse/
nameに一致する部分はtextから消したいけど、HTMLリンクにされちゃってるからめんどくさそう
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"_misskey_quote": {
"@id": "https://misskey-hub.net/ns#_misskey_quote",
"@type": "@id"
}
}
],
"id": "https://threads.net/ap/users/17841401320063525/post/18008415914340816/",
"type": "Note",
"content": "<p>15分ほどの遅延がありつつも無事に配信されてきた<br /><br />RE: <a href=\"https://www.threads.net/@takenoko_0714/post/C4zDRu7yhc8-873y4MYCk19PLtq0nmjNbduTGA0\" data-lnfb-mode=\"ie\">https://www.threads.net/@takenoko_0714/post/C4zDRu7yhc8-873y4MYCk19PLtq0nmjNbduTGA0</a></p>",
"published": "2024-03-21T18:49:04-07:00",
"attributedTo": "https://threads.net/ap/users/17841401320063525/",
"url": "https://www.threads.net/@takenoko_0714/post/C4zHWlsy6YqIZgOuMc9KofephV7aGV-gnz6aUU0",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://threads.net/ap/users/17841401320063525/followers/"
],
"tag": [
{
"type": "Link",
"mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
"rel": "https://misskey-hub.net/ns#_misskey_quote",
"href": "https://threads.net/ap/users/17841401320063525/post/17993484902354950/",
"name": "RE: https://www.threads.net/@takenoko_0714/post/C4zDRu7yhc8-873y4MYCk19PLtq0nmjNbduTGA0"
}
],
"attachment": [
{
"type": "Image",
"url": "https://scontent-nrt1-2.cdninstagram.com/v/t51.29350-15/434027463_922720669586605_7080026249163492925_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=18de74&_nc_ohc=HbDtg8IDZJwAX_XZr4D&_nc_ht=scontent-nrt1-2.cdninstagram.com&oh=00_AfB2_tV3o6HZ9W-npsdwdqlQU-HAbLtavStj2sxVCA7XYQ&oe=66027D83",
"width": 1179,
"height": 884
}
],
"_misskey_quote": "https://threads.net/ap/users/17841401320063525/post/17993484902354950/"
}