在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):NicolasConstant/mastodon.NET开源软件地址(OpenSource Url):https://github.com/NicolasConstant/mastodon.NET开源编程语言(OpenSource Language):C# 100.0%开源软件介绍(OpenSource Introduction):mastodon.NETMastodon API Wrapper in C# .NET Still work in progress, insights and pull requests welcome! InstallFind it on Nuget
Current stateAs most other mastodon .NET wrappers aren't working anymore, this lib is 100% functionnal for the set of API functionnalities it covers at the date of 09 June 2018. API coverage[WIP] How toRegister app using(var appHandler = new AppHandler("InstanceName")){
var scopes = AppScopeEnum.Read | AppScopeEnum.Write | AppScopeEnum.Follow;
var appData = await appHandler.CreateAppAsync("MyAppName", scopes, "ProjectUri");
} See scope definition Retrieve OAuth Token per email/password using(var authHandler = new AuthHandler("InstanceName")){
var tokenInfo = await authHandler.GetTokenInfoAsync("ClientId", "ClientSecret", "UserEmail", "UserPassword", AppScopeEnum.Read);
} Retrieve OAuth Token per Oauth Code Workflow using(var authHandler = new AuthHandler("InstanceName")){
var oauthCodeUrl = authHandler.GetOauthCodeUrl("ClientId", AppScopeEnum.Read);
//Open browser/gui to open the oauth url and retrieve the oauth code
var code = GetCodeFromBrowser(oauthCodeUrl);
var tokenInfo = await authHandler.GetTokenInfoAsync("ClientId", "ClientSecret", code);
} Access API via Client using(var client = new MastodonClient("InstanceName")){
var timeline = await client.GetHomeTimelineAsync("access_token");
} See Mastodon API AuthorNicolas Constant (mastodon) Licensemastodon.NET is available under the MIT license. See the LICENSE file for more info. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论