{"id":22631272,"url":"https://github.com/cucmberium/tootnet","last_synced_at":"2025-04-05T18:06:53.821Z","repository":{"id":89691723,"uuid":"105148770","full_name":"cucmberium/TootNet","owner":"cucmberium","description":"Yet Another .NET Mastodon Library","archived":false,"fork":false,"pushed_at":"2024-10-30T15:15:40.000Z","size":454,"stargazers_count":44,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T18:06:49.744Z","etag":null,"topics":["library","mastodon","mastodon-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cucmberium.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-28T13:01:56.000Z","updated_at":"2025-02-23T14:48:58.000Z","dependencies_parsed_at":"2024-03-06T15:04:56.304Z","dependency_job_id":"583c446a-7321-4bba-8c70-74f74f22ab0f","html_url":"https://github.com/cucmberium/TootNet","commit_stats":{"total_commits":107,"total_committers":4,"mean_commits":26.75,"dds":"0.23364485981308414","last_synced_commit":"0f9a1fe7b4f92edf8b4f4978c985818cb2fb9998"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucmberium%2FTootNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucmberium%2FTootNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucmberium%2FTootNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucmberium%2FTootNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cucmberium","download_url":"https://codeload.github.com/cucmberium/TootNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378141,"owners_count":20929296,"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":["library","mastodon","mastodon-api"],"created_at":"2024-12-09T02:07:56.375Z","updated_at":"2025-04-05T18:06:53.797Z","avatar_url":"https://github.com/cucmberium.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# TootNet\n\n [![NuGetBadge](https://img.shields.io/nuget/v/TootNet.svg)](https://www.nuget.org/packages/TootNet)\n\nTootNet は.NET Standard向けのマストドンライブラリです。\n\nこのライブラリはTwitterライブラリの[CoreTweet](https://github.com/CoreTweet/CoreTweet)と同じように直感的にAPIにアクセスできるように設計されています。\n\n### Sample\n\n基本的な使い方は[Demo](https://github.com/cucmberium/TootNet/tree/master/TootNet.Demo)をご覧ください。\n\nまた、[テストコード](https://github.com/cucmberium/TootNet/tree/master/TootNet.Tests)には、すべてのAPIの簡易的な使い方が学べます。\n\nTootNetではほぼ公式APIと対応がとれているため[こちら](https://docs.joinmastodon.org/api/)の公式ドキュメントも同様に参考になります。\n\n認証:\n```cs\n// Create new app\nvar authorize = new Authorize();\nawait authorize.CreateApp(\"mstdn.jp\", \"yourclientnamehere\", Scope.Read | Scope.Write);\n\n// Authorize with code\nvar authorizeUrl = authorize.GetAuthorizeUri();\nConsole.WriteLine(authorizeUrl);\nvar code = Console.ReadLine().Trim();\nvar tokens = await authorize.AuthorizeWithCode(code);\n```\n\nトゥート:\n```cs\nusing (var fs = new FileStream(@\"./picture.png\", FileMode.Open, FileAccess.Read))\n{\n    // toot with picture\n    var attachment = await tokens.MediaAttachments.PostAsync(file =\u003e fs);\n    await tokens.Statuses.PostAsync(status =\u003e \"test toot\", visibility =\u003e \"private\", media_ids =\u003e new List\u003clong\u003e() { attachment.Id });\n}\n```\n\nタイムラインの取得:\n```cs\nvar statuses = await tokens.Timelines.HomeAsync(limit =\u003e 10);\n\nforeach (var status in statuses)\n    Console.WriteLine(status.Content);\n```\n\n\nReactiveExtensionsを用いたストリーミング:\n```cs\nvar observable = tokens.Streaming.UserAsObservable();\nvar disposable = observable.Subscribe(x =\u003e\n{\n    switch (x.Type)\n    {\n        case StreamingMessage.MessageType.Status:\n            Console.WriteLine(x.Status.Account.Acct + x.Status.Content);\n            break;\n    }\n});\n\nawait Task.Delay(TimeSpan.FromSeconds(30));\ndisposable.Dispose();\n```\n\n### Platforms\n\n* .NET Standard\n\n### License\n\nThis software is licensed under the MIT License.\n\nこのライブラリでは以下のライブラリの一部のコードを使用しています。\n* [Mastonet](https://github.com/glacasa/Mastonet)\n* [CoreTweet](https://github.com/CoreTweet/CoreTweet)\n\n### Other\n\nプルリクエストはいつでも歓迎です！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucmberium%2Ftootnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcucmberium%2Ftootnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucmberium%2Ftootnet/lists"}