https://github.com/dance2die/myanimelistsharp
Access MyAnimeList Web API using .NET library
https://github.com/dance2die/myanimelistsharp
anime asynchronous csharp dotnet facade manga nuget
Last synced: 4 months ago
JSON representation
Access MyAnimeList Web API using .NET library
- Host: GitHub
- URL: https://github.com/dance2die/myanimelistsharp
- Owner: dance2die
- License: mit
- Created: 2015-08-31T18:13:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-17T23:50:30.000Z (over 8 years ago)
- Last Synced: 2025-03-20T20:14:27.435Z (8 months ago)
- Topics: anime, asynchronous, csharp, dotnet, facade, manga, nuget
- Language: PowerShell
- Homepage:
- Size: 1.82 MB
- Stars: 15
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to MyAnimeListSharp
## The "Easiest" way to search Anime/Manga
* **What**: .NET library for accessing MyAnimeList.net Web API ([API Documentation](http://myanimelist.net/modules.php?go=api))
* **Framework**: .NET 4.5.2
* **Contact Info**: [@SlightEdgeCoder](https://twitter.com/SlightEdgeCoder)
* **License**: [The MIT License](http://opensource.org/licenses/MIT)
## Overview
### Facade makes the coding "Simple" and "Easy" to use.
There is a 1:1 matching between the Web API and the source code.

These four [facade](https://github.com/dance2die/Project.MyAnimeList/tree/master/Project.MyAnimeList/Project.MyAnimeList/Facade) classes are the only classes you need to deal with.
* [AccountMethods.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/AccountMethods.cs)
* [AnimeListMethods.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/AnimeListMethods.cs)
* [MangaListMethods.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/MangaListMethods.cs)
* [SearchMethods.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/SearchMethods.cs)
### Asynchronous versions of facades are added in Version 1.3
####The difference between Synchronous and Asynchronous version:
`SearchMethods` is separated into two different files (subject to change in later version):
1. [MangaSearchMethodsAsync.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/Async/MangaSearchMethodsAsync.cs)
2. [AnimeListMethodsAsync.cs](https://github.com/dance2die/Project.MyAnimeList/blob/master/Project.MyAnimeList/Project.MyAnimeList/Facade/Async/AnimeListMethodsAsync.cs)

###Source is located under
[Project.MyAnimeList/Project.MyAnimeList/Project.MyAnimeList/Facade/Async](https://github.com/dance2die/Project.MyAnimeList/tree/master/Project.MyAnimeList/Project.MyAnimeList/Facade/Async)
## How to Install
### Nuget
[Install-Package MyAnimeListSharp](https://www.nuget.org/packages/MyAnimeListSharp/)
## Examples
### Search Manga
```c#
// Step 1: Enter UserName and Password information
ICredentialContext credential = new CredentialContext
{
UserName = "",
Password = ""
};
// Step 2: Create a method object
var searchMethods = new SearchMethods(credential);
// Step 3: Search using the search term ("Full Metal" in this case)
string response = searchMethods.SearchAnime("Full Metal");
```
### Search Manga Asynchronously: New* in Version 1.3
```c#
ICredentialContext credential = new CredentialContext
{
UserName = "",
Password = ""
};
var asyncMangaSearcher = new MangaSearchMethodsAsync(credential);
var response = await asyncMangaSearcher.SearchAsync("Dagashi Kashi");
```
### Search Anime
```c#
// Step 1: Enter UserName and Password information
ICredentialContext credential = new CredentialContext
{
UserName = "",
Password = ""
};
// Step 2: Create a method object
var searchMethods = new SearchMethods(credential);
// Step 3: Search using the search term ("Code Geass" in this case)
string mangaResponse = searchMethods.SearchManga("Code Geass");
Console.WriteLine(mangaResponse);
```
### Search Anime Asynchronously: New* in Version 1.3
```c#
ICredentialContext credential = new CredentialContext
{
UserName = "",
Password = ""
};
var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
var response = await asyncAnimeSearcher.SearchAsync("Naruto");
```
### Add Anime
```c#
var methods = new AnimeListMethods(credential);
var animeValues = new AnimeValues
{
AnimeStatus = AnimeStatus.Watching,
Comments = "It was a great series."
};
var responseText = methods.AddAnime(ANIME_ID, animeValues);
Console.WriteLine(responseText);
```
### Add Manga
```c#
var methods = new MangaListMethods(credential);
var mangaValues = new MangaValues
{
MangaStatus = MangaStatus.Reading,
Comments = "I am planning to read this"
};
var responseText = methods.AddManga(MANGA_ID, mangaValues);
Console.WriteLine(responseText);
```
### Convert Response object to XML/JSON strings: New* in Version 1.3.1
```c#
var asyncMangaSearcher = new MangaSearchMethodsAsync(credential);
MangaSearchResponse response = await asyncMangaSearcher.SearchDeserializedAsync("Dagashi Kashi");
Console.WriteLine(response.ToJson());
Console.WriteLine(response.ToXml());
```