mastodon.zunda.ninja is one of the many independent Mastodon servers you can use to participate in the fediverse.
Zundon is a single user instance as home of @zundan as well as a test bed for changes of the code.

Administered by:

Server stats:

1
active users

zunda

Streaming APIのかんさつ

- /web/timelines/publicから読み込まれた/api/v1/streaming/?access_token=********&stream=publicを別のタブから読もうとするとerror: "Error: Missing access token"になる
- /web/timelines/publicをリロードしてもaccess_tokenは変化しない
- クッキーを送らなくても読める
- Acceptリクエストヘッダは必要
- Sec-WebSocket-Versionリクエストヘッダは必要
- Upgradeリクエストヘッダは必要
- Sec-WebSocket-Keyヘッダは必要

というわけで最小のcurlラインは下記のような感じ。

curl 'https://<ホスト名>//api/v1/streaming/?access_token=<トークン>&stream=public' -H 'Host: <ホスト名>' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: <キー>==' -H 'Upgrade: websocket’

ログインしていることを証明する必要はないんだねえ