{"id":16683640,"url":"https://github.com/yamachu/mastodonscriptbot","last_synced_at":"2026-05-16T17:14:09.139Z","repository":{"id":79718983,"uuid":"89044435","full_name":"yamachu/MastodonScriptBot","owner":"yamachu","description":"Mastodon Bot with Roslyn for Scripting: Mastodon-no-anal \u003e Amazing Notified-driven Automatic Literal-bot","archived":false,"fork":false,"pushed_at":"2017-04-27T04:01:35.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T13:54:12.962Z","etag":null,"topics":["csharp","mastodon","mastodon-app","roslyn"],"latest_commit_sha":null,"homepage":"","language":"C#","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/yamachu.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-22T04:32:13.000Z","updated_at":"2017-05-05T17:43:40.000Z","dependencies_parsed_at":"2023-03-06T23:00:13.514Z","dependency_job_id":null,"html_url":"https://github.com/yamachu/MastodonScriptBot","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"f4d6e7f13953482ea6a77e461127e6cd45709144"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FMastodonScriptBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FMastodonScriptBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FMastodonScriptBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FMastodonScriptBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamachu","download_url":"https://codeload.github.com/yamachu/MastodonScriptBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243403229,"owners_count":20285378,"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":["csharp","mastodon","mastodon-app","roslyn"],"created_at":"2024-10-12T14:25:38.062Z","updated_at":"2026-05-16T17:14:09.091Z","avatar_url":"https://github.com/yamachu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MastodonScriptBot\n\nMastodon の {User,Public,Hashtag}Stream を監視していい感じに Bot っぽいことをするアプリケーション．\n\nプログラムの動作中でも動作を変えることが出来て楽しい ✌ ('ω' ✌ )三 ✌ ('ω') ✌ 三( ✌ 'ω') ✌ \n\n## Usage\n\nCSharpScript にはグローバル変数として\n\n* MSStream : Streaming (Sample では PublicStream)\n* Client : MastodonClient\n\nが渡されているので，その 2変数 に対しての操作を行う．\n\nCSharpScript からは Subscribe した際に返る IDisposable を return すれば良い．\n\n### example\n\nWatchTootAll\n\n```csharp\n\nMSStream.OfType\u003cStatus\u003e()\n.Subscribe(x =\u003e Console.WriteLine($\"{x.Account.FullUserName}: {x.Content}\"))\n\n```\n\nAutoFavSpecificWord\n\n```csharp\n\nMSStream.OfType\u003cStatus\u003e()\n.Where(x =\u003e x.Content.Contains(\"Xamarin\"))\n.Subscribe(x =\u003e \n{\n    System.Console.WriteLine($\"{x.Account.FullUserName}: {x.Content}\");\n    Client.Favourite(x.Id);\n})\n\n```\n\nもちろん Method の定義も出来て，Toot の数が数えたい！という時は\n\nCountAllToolOfSubscribed\n\n```csharp\n\nstatic int i = 0;\n\nIDisposable WithMethod()\n{\n    return MSStream.OfType\u003cStatus\u003e()\n    .Subscribe(x =\u003e System.Console.WriteLine($\"!!--{i++}--!!\"));\n}\n\nreturn WithMethod();\n\n```\n\nその他にも色々出来そうなので自分だけの Stream を作ってみてください．\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamachu%2Fmastodonscriptbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamachu%2Fmastodonscriptbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamachu%2Fmastodonscriptbot/lists"}