NI-Lab.

nilog:

← 前の日 2023-02-05 次の日 →
← 一年前 一年後 →
Mastodon (2023-02-05)

画像の説明欄に入力したテキストは media_attachments.description に入る。

"meta": {
"original": {
"width": 1024,
"height": 1024,
"size": "1024x1024",
"aspect": 1
},
"small": {
"width": 480,
"height": 480,
"size": "480x480",
"aspect": 1
},
"focus": {
"x": 0,
"y": 0
}
},
"description": "説明欄入力テスト。"
}
]
}


[Mastodon] 2023-02-05 08:33:57
関連するかも情報

JPEGアップロードしたトゥートのデータ構造。contentに画像情報は入らない。JPEG画像にもトゥートとは別のIDが振られている。

{
"id": "109808987239255311",
"content": "<p>『星』と『サンペレグリノ』と『ちいかわ モモンガ』のJPEG画像アップロードテスト。</p>",
"media_attachments": [
{
"id": "109808981639506463",
"type": "image",
"url": JPEG画像のURL(originalサイズ),
"preview_url": JPEG画像のURL(smallサイズ),


[Mastodon] 2023-02-05 08:33:25

画像の説明欄に入力したテキストは media_attachments.description に入る。

"meta": {
"original": {
"width": 1024,
"height": 1024,
"size": "1024x1024",
"aspect": 1
},
"small": {
"width": 480,
"height": 480,
"size": "480x480",
"aspect": 1
},
"focus": {
"x": 0,
"y": 0
}
},
"description": "説明欄入力テスト。"
}
]
}


[Mastodon] 2023-02-05 08:33:57

Mastodon はインデントが表示に反映されている気がする。もしかしてソースコードやアスキーアートが書きやすいのでは。


[Mastodon] 2023-02-05 08:34:57

JSONサンプル。

{
"id": "0001",
"users": [
{
"name": "Alice"
},
{
"name": "Bob"
}
]
}


[Mastodon] 2023-02-05 09:38:20

APIで取得したもの。

"content": "<p>JSONサンプル。</p><p>{<br /> &quot;id&quot;: &quot;0001&quot;,<br /> &quot;users&quot;: [<br /> {<br /> &quot;name&quot;: &quot;Alice&quot;<br /> },<br /> {<br /> &quot;name&quot;: &quot;Bob&quot;<br /> }<br /> ]<br />}</p>"


[Mastodon] 2023-02-05 09:39:33

トゥートをブーストすると content が空文字列になって、reblog.content にブーストした内容が入っている。

"content": ""

"reblog": {
"content": "<p>What is Mastodon? An animated video: (以下略)

ブーストじゃない自分のトゥートは

"reblog": null

になってる。


[Mastodon] 2023-02-05 09:51:10

ハッシュタグのテスト


[Mastodon] 2023-02-05 10:16:44

APIで取得した結果。

"content": "<p>ハッシュタグのテスト <a href=\"mastodon-japan.net/tags/nilab\" class=\"mention hashtag\" rel=\"tag\">#<span>nilab</span></a> <a href=\"mastodon-japan.net/tags/test\" class=\"mention hashtag\" rel=\"tag\">#<span>test</span></a></p>"

"tags": [
{
"name": "nilab",
"url": "mastodon-japan.net/tags/nilab"
},
{
"name": "test",
"url": "mastodon-japan.net/tags/test"
}
]


[Mastodon] 2023-02-05 10:19:21

おおっと

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near


[Mastodon] 2023-02-05 10:41:51

自分が Mastodon にトゥートしたものを自前のデータベースに保存するプログラムを書き始める(*´∀`*) 今回は Python で書くぞ。


[Mastodon] 2023-02-05 10:43:00

Mastodon は Ruby で書かれているので、関連するプログラムを書くなら Ruby のほうがいいかなと思わないでもなかったけどまぁ・・・


[Mastodon] 2023-02-05 10:43:44

おなかすいた12時


[Mastodon] 2023-02-05 12:00:43

ふぅー( ´∀`)


[Mastodon] 2023-02-05 14:06:45

Mastodonの自分のトゥートを自前のデータベースに保存するスクリプトをやっと書けた。


[Mastodon] 2023-02-05 16:08:44

MacBook Air のバッテリーが残り少ない


[Mastodon] 2023-02-05 16:28:37

Mastodon の自分のトゥートを、Webサイトに表示するところまでできた。

nilog: Mastodon (2023-02-03) nilab.info/nilog/?type=m1&id=1



元の画像を見る
[Mastodon] 2023-02-05 20:38:37

画像の取り込みとかまだいろいろできていないのだけどとりあえず。


[Mastodon] 2023-02-05 20:41:06

Webフロント部分を Nuxt 3 か Next.js にして表示部分をコンポーネント化したくなってきた。いつかやる(かも)。


[Mastodon] 2023-02-05 20:42:05

(:3[___]


[Mastodon] 2023-02-05 22:24:26
2023年02年05日のnilogをすべて表示する

- NI-Lab.
- Mastodon (@nilab@mastodon-japan.net)
- Twitter (@nilab)
- Timelog (@nilab)
- はてなブックマーク (id:nilab)

Web Services by Yahoo! JAPAN