{"id":17338031,"url":"https://github.com/takahashim/mastodon-book-sample","last_synced_at":"2025-04-14T18:41:39.695Z","repository":{"id":66277941,"uuid":"89846415","full_name":"takahashim/mastodon-book-sample","owner":"takahashim","description":"sample code of \"Mastodon Book\" http://nextpublishing.jp/book/8776.html","archived":false,"fork":false,"pushed_at":"2017-05-03T07:12:57.000Z","size":131,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-13T12:57:49.589Z","etag":null,"topics":["mastodon","mastodon-apis","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takahashim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-30T11:20:52.000Z","updated_at":"2019-11-26T04:02:29.000Z","dependencies_parsed_at":"2023-02-26T04:17:30.386Z","dependency_job_id":null,"html_url":"https://github.com/takahashim/mastodon-book-sample","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"12e02afbe17242b6cb5efe6c94c9086d5c37bf20"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahashim%2Fmastodon-book-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahashim%2Fmastodon-book-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahashim%2Fmastodon-book-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahashim%2Fmastodon-book-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takahashim","download_url":"https://codeload.github.com/takahashim/mastodon-book-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248938235,"owners_count":21186368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mastodon","mastodon-apis","ruby"],"created_at":"2024-10-15T15:36:59.741Z","updated_at":"2025-04-14T18:41:39.654Z","avatar_url":"https://github.com/takahashim.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample code of \"Mastodon Book\"\n\nThis repository have sample code repository for \"Kore-ga Mastodon da!\"(Impress R\u0026D, ISBN: 9784844397724).\n\n## How to use\n\n* modify config.yml; get access_token and write it.\n    * If you want to get access_token on trial, try https://takahashim.github.io/mastodon-access-token/ .\n* execute `bundle install`\n* execute `bundle exec toot.rb` or `bundle exec timeline.rb`\n\n## REST API samples\n\n* [toot hello](./toot_hello/): toot simply \"hello\"\n* [toot in private](./toot_private/): reply toot with \"private\" visibility\n* [toot with image](./toot_image/): toot with image\n* [timeline by REST API](./rest_timeline/): get timeline using REST API\n\n## Streaming API samples\n\n* [timeline by Streaming API](./streaming_timeline/): get timeline using Streaming API\n\n-----\n\n(In Japanese)\n\n# 「これがマストドンだ！」サンプルコード\n\n[マストドン研究会編『これがマストドンだ！　使い方からインスタンスの作り方まで』（インプレスR\u0026D, ISBN: 9784844397724）](http://nextpublishing.jp/book/8776.html)の中の「マストドンAPIの叩き方」という章のサンプルコードです。\n\n紙面の都合上、完全に動くコードは掲載できなかったのですが、こちらは完全版になっています。\n\n## 使い方\n\n* access_tokenを取得して、その値をconfig.ymlに書き込む\n    * 実験用にaccess_tokenを用意したい場合、 https://takahashim.github.io/mastodon-access-token/ で取得できます\n* `bundle install` を実行する\n* `bundle exec toot.rb` または `bundle exec timeline.rb` を実行する\n\n## REST APIサンプル\n\n* [toot hello](./toot_hello/): 単に\"hello\"とトゥートするサンプル\n* [toot in private](./toot_private/): visibilityを\"private\"にして、リプライとしてトゥートするサンプル\n* [toot with image](./toot_image/): 画像つきでトゥートするサンプル\n* [timeline by REST API](./rest_timeline/): REST APIでタイムラインを取得するサンプル\n\n## Streaming APIサンプル\n\n* [timeline by Streaming API](./streaming_timeline/): Streaming APIでタイムラインを取得するサンプル\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakahashim%2Fmastodon-book-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakahashim%2Fmastodon-book-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakahashim%2Fmastodon-book-sample/lists"}