Coder Social home page Coder Social logo

myanimelistsharp's Introduction

Welcome to MyAnimeListSharp

The "Easiest" way to search Anime/Manga

Overview

Facade makes the coding "Simple" and "Easy" to use.

There is a 1:1 matching between the Web API and the source code. Image of Facade

These four facade classes are the only classes you need to deal with.

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
  2. AnimeListMethodsAsync.cs Image of Comparison

###Source is located under Project.MyAnimeList/Project.MyAnimeList/Project.MyAnimeList/Facade/Async

How to Install

Nuget

Install-Package MyAnimeListSharp

Examples

Search Manga

	// Step 1: Enter UserName and Password information
	ICredentialContext credential = new CredentialContext
	{
		UserName = "<MyAnimeList.NET UserName>",
		Password = "<MyAnimeList.NET 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

	ICredentialContext credential = new CredentialContext
	{
		UserName = "<MyAnimeList.NET UserName>",
		Password = "<MyAnimeList.NET Password>"
	};
	
	var asyncMangaSearcher = new MangaSearchMethodsAsync(credential);
	var response = await asyncMangaSearcher.SearchAsync("Dagashi Kashi");

Search Anime

	// Step 1: Enter UserName and Password information
	ICredentialContext credential = new CredentialContext
	{
		UserName = "<MyAnimeList.NET UserName>",
		Password = "<MyAnimeList.NET 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

	ICredentialContext credential = new CredentialContext
	{
		UserName = "<MyAnimeList.NET UserName>",
		Password = "<MyAnimeList.NET Password>"
	};

	var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
	var response = await asyncAnimeSearcher.SearchAsync("Naruto");

Add Anime

	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

	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

	var asyncMangaSearcher = new MangaSearchMethodsAsync(credential);
	MangaSearchResponse response = await asyncMangaSearcher.SearchDeserializedAsync("Dagashi Kashi");

	Console.WriteLine(response.ToJson());
	Console.WriteLine(response.ToXml());

myanimelistsharp's People

Contributors

dance2die avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

myanimelistsharp's Issues

InvalidOperationException by anime Search

Hello ,

i'm pretty new to programming and right now i try to make my own small anime list. Got a small problem and can't figure out how to solve it , + not realy sure where to ask it.

I have made so that when i try to search for something and there is not such thing i get a message

if (string.IsNullOrWhiteSpace(response)) { MessageBox.Show("No such thing"); }

but after that when i try to search for something else i I get an

InvalidOperationException: Operation is not valid due to the current state of the object. In MyAnimeListSharp.Core.MyAnimeListMethods.<GetResponseTextAsync>d__5.MoveNext()

And after i close this error message i can search normaly again.

If you have time, i would appreciate if you could give me some tips on how to handle this error.

Thank you in advance !!

Get entire list of entries

The only thing missing is the ability to download the entire list of either anime or manga entries. Are you planning to implement this? or have I missed it somewhere...

Invalid Score by MAL Update

Good day,

it's me again. Today i was trying to implement the update function to my small program and found a wierd thing. When you update the Score in AnimeValues , it updates the score by previous value . So when i put Score.MasterPiece on MAL it shows as Great or Score.Appalling is actualy - ( nothing ) on MAL.

here is my code if you need it :

        var AnimeId = Convert.ToInt32(tbWatchingID.Text);
        var EpsWatched = Convert.ToInt16(tbWatchingEpWatched.Text);
        var PersScore = Convert.ToInt32(tbPersScoreWatch.Text);
        
        var methods = new AnimeListMethods(credential);
        

        if (PersScore == 0 || PersScore == 1)
        {
            var animeValues = new AnimeValues
            {
               Episode = EpsWatched,
               Score = Score.Appalling
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
            
        }
        else if (PersScore == 2)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Horrible
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 3)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.VeryBad
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 4)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Bad
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 5)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Average
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 6)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Fine
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 7)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Good
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 8)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.VeryGood
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if (PersScore == 9)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.Great
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }
        else if(PersScore == 10)
        {
            var animeValues = new AnimeValues
            {
                Episode = EpsWatched,
                Score = Score.MasterPiece
            };

            var response = methods.UpdateAnime(AnimeId, animeValues);
        }

        MessageBox.Show("Updated");

Thank you for your time !

Cannot parse xml on search

Hi im trying to use the anime search function but it is unable to parse the xml that your wrapper is getting.
XmlException: Data at the root level is invalid. Line 1, position 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.