All Projects → yamachu → Mastodot

yamachu / Mastodot

Licence: MIT license
C# Library for Mastodon API. Easy Toot!

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Mastodot

mastodon.js
Javascript Mastodon API for Web Browsers with streaming support
Stars: ✭ 32 (+88.24%)
Mutual labels:  mastodon, mastodon-apis
docker-mastodon
All-in-one unofficial Mastodon Docker image, if you want that.
Stars: ✭ 28 (+64.71%)
Mutual labels:  mastodon
social-media-hacker-list
Growing list of apps and tools for enhancing social media experiences.
Stars: ✭ 198 (+1064.71%)
Mutual labels:  mastodon
nanoFramework.Hardware.Esp32
📦 nanoFramework Hardware.Esp32 Class Library
Stars: ✭ 25 (+47.06%)
Mutual labels:  csharp-library
mastodon-autofollow
Autofollow bot for mastodon
Stars: ✭ 28 (+64.71%)
Mutual labels:  mastodon
feedpushr
A simple feed aggregator daemon with sugar on top.
Stars: ✭ 222 (+1205.88%)
Mutual labels:  mastodon
feedspora
FeedSpora posts RSS/Atom feeds to your social network accounts.
Stars: ✭ 31 (+82.35%)
Mutual labels:  mastodon
EndianBinaryIO
A C# library that can read and write primitives, enums, arrays, and strings to streams and byte arrays with specified endianness, string encoding, and boolean sizes.
Stars: ✭ 20 (+17.65%)
Mutual labels:  csharp-library
iMast
📱🐘 3rd-party Mastodon Client for iOS
Stars: ✭ 93 (+447.06%)
Mutual labels:  mastodon
RESTCountries.NET
.NET Standard wrapper library around the API provided by REST Countries https://restcountries.com. The world in .NET 🔥.
Stars: ✭ 33 (+94.12%)
Mutual labels:  csharp-library
LiteNetwork
A simple and fast .NET networking library compatible with .NET Standard 2, .NET 5, 6 and 7.
Stars: ✭ 66 (+288.24%)
Mutual labels:  csharp-library
fie
Small and cute social media CLI.
Stars: ✭ 24 (+41.18%)
Mutual labels:  mastodon
BakingSheet
Easy datasheet management for C# and Unity. Supports Excel, Google Sheet, JSON and CSV format.
Stars: ✭ 144 (+747.06%)
Mutual labels:  csharp-library
mastodon ynh
Free, open-source social network for YunoHost
Stars: ✭ 67 (+294.12%)
Mutual labels:  mastodon
emuarius
Bridge between Twitter and Mastodon
Stars: ✭ 53 (+211.76%)
Mutual labels:  mastodon
polybot
A framework for making social media bots for multiple networks
Stars: ✭ 33 (+94.12%)
Mutual labels:  mastodon
mastodo
A fork of the GNU Social/AP-compatible microblogging server
Stars: ✭ 29 (+70.59%)
Mutual labels:  mastodon
Cyotek.Drawing.BitmapFont
Component for parsing bitmap font files generated by AngelCode's BMFont utility
Stars: ✭ 35 (+105.88%)
Mutual labels:  csharp-library
documentation
Mastodon documentation
Stars: ✭ 1,485 (+8635.29%)
Mutual labels:  mastodon
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-35.29%)
Mutual labels:  csharp-library

Mastodot - Mastodon API library for C# (.NET)

NuGetBadge

日本語はこちら

Sample code

See example

Sample code contains how to generate tokens, toot, and subscribe stream.

Regist an app to Mastodon Instance

var registeredApp = await ApplicationManager.RegistApp("Host name" /* ex: mastodon.cloud */, "Your Application Name", Scope.Read | Scope.Write | Scope.Follow);

registeredApp contains ClienID and ClientSecret.

Login and get AccessToken

// if login by email
var tokens = ApplicationManager.GetAccessTokenByEmail(registeredApp, "Email", "Password");

// if login by use OAuth
var url = ApplicationManager.GetOAuthUrl(registeredApp);
// access this url via browser, HttpClient, ...
var tokens = await ApplicationManager.GetAccessTokenByCode(registeredApp, "Code that Browser shows");

tokens contains AccessToken. You can access Mastodon API by using this AccessToken.

Using Mastodon API

This code is how to Toot.

var client = new MastodonClient("Host name (url)", tokens.AccessToken);
client.PostNewStatus(status: "Hello Mastodon!");
// With media
var attachment = await client.UploadMedia("File Path");
client.PostNewStatus("Look my cuuuuute dog!", mediaIds: new int[]{attachment.Id});

and Using StreamAPI

var publicStream = client.GetObservablePublicTimeline()
                    .OfType<Status>()
                    .Subscribe(x => Console.WriteLine($"{x.Account.FullUserName} Tooted: {x.Content}"));

MastodonAPIs

Mastodon APIs

All APIs is ready

Accounts

  • GET /api/v1/accounts/:id
  • GET /api/v1/accounts/verify_credentials
  • PATCH /api/v1/accounts/update_credentials
  • GET /api/v1/accounts/:id/followers
  • GET /api/v1/accounts/:id/following
  • GET /api/v1/accounts/:id/statuses
  • POST /api/v1/accounts/:id/follow
  • POST /api/v1/accounts/:id/unfollow
  • POST /api/v1/accounts/:id/block
  • POST /api/v1/accounts/:id/unblock
  • POST /api/v1/accounts/:id/mute
  • POST /api/v1/accounts/:id/unmute
  • GET /api/v1/accounts/relationships
  • GET /api/v1/accounts/search

Apps

  • POST /api/v1/apps

Blocks

  • GET /api/v1/blocks

Favourites

  • GET /api/v1/favourites

Follow Requests

  • GET /api/v1/follow_requests
  • POST /api/v1/follow_requests/:id/authorize
  • POST /api/v1/follow_requests/:id/reject

Follows

  • POST /api/v1/follows

Instances

  • GET /api/v1/instance

Media

  • POST /api/v1/media

Mutes

  • GET /api/v1/mutes

Notifications

  • GET /api/v1/notifications
  • GET /api/v1/notifications/:id
  • POST /api/v1/notifications/clear

Reports

  • GET /api/v1/reports
  • POST /api/v1/reports

Search

  • GET /api/v1/search

Statuses

  • GET /api/v1/statuses/:id
  • GET /api/v1/statuses/:id/context
  • GET /api/v1/statuses/:id/card
  • GET /api/v1/statuses/:id/reblogged_by
  • GET /api/v1/statuses/:id/favourited_by
  • POST /api/v1/statuses
  • DELETE /api/v1/statuses/:id
  • POST /api/v1/statuses/:id/reblog
  • POST /api/v1/statuses/:id/unreblog
  • POST /api/v1/statuses/:id/favourite
  • POST /api/v1/statuses/:id/unfavourite

Timelines

  • GET /api/v1/timelines/home
  • GET /api/v1/timelines/public
  • GET /api/v1/timelines/tag/:hashtag

Streaming

  • GET /api/v1/streaming/user
  • GET /api/v1/streaming/public
  • GET /api/v1/streaming/hashtag

License

MIT

Other

Welcode pull requests!

For developer

For support multi target frameworks, Mastodot.csproj is not supported format.

When edit and debug this library, replace <TargetFrameworks>netstandard1.1;netstandard1.3</TargetFrameworks> to <TargetFramework>netstandard1.1</TargetFramework> or <TargetFramework>netstandard1.1</TargetFramework>

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].