GithubHelp home page GithubHelp logo

nktn / malkit Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 56 KB

Swift API Client for MyAnimeList (https://myanimelist.net/modules.php?go=api)

License: MIT License

Objective-C 0.82% Swift 88.84% Ruby 10.34%
myanimelist swift carthage pod

malkit's Introduction

Carthage compatible Pod Version Pod Platform Pod License Swift version

MalKit

====

Description

Swift API Client for MyAnimeList(official API)

https://myanimelist.net/modules.php?go=api

Requirement

Xcode9.0〜(Swift4)

Usage

Initialize

import MalKit
let malkit = MalKit()

Setup(MyAnimeList account for request API)

malkit.setUserData(userId: "xxxxxx", passwd: "yyyyyy")

Search Sample

malkit.searchAnime("naruto", completionHandler: { (items, status, err) in
    //result is Data(XML). You need to parse XML.
    //status is HTTPURLResponse
    //your process
})
malkit.searchManga("naruto", completionHandler: { (items, status, err) in
    //result is Data(XML). You need to parse XML.
    //status is HTTPURLResponse
    //your process
})

Add or Update anime/manga on your list. For additional Anime parameters, please refer here. For Manga, please refer here.

add Sample

malkit.addAnime(20, params:["status": 1], completionHandler: { (result, status, err) in
     //20 is anime_id
     //result is Bool
     //status is HTTPURLResponse
     //your process
})
malkit.addManga(20, params:["status": 1], completionHandler: { (result, status, err) in
     //20 is manga_id
     //result is Bool
     //status is HTTPURLResponse
     //your process
})

update Sample

malkit.updateAnime(20, params:["status": 0, "comments": "test"], completionHandler: { (result, status, err) in
     //20 is anime_id
     //result is Bool
     //status is HTTPURLResponse
     //your process
})
malkit.updateManga(20, params:["status": 0, "comments": "test"], completionHandler: { (result, status, err) in
     //20 is manga_id
     //result is Bool
     //status is HTTPURLResponse
     //your process
})

delete Sample

malkit.deleteAnime(20, completionHandler: { (result, status, err) in
      //20 is anime_id
      //result is Bool
      //status is HTTPURLResponse
      //your process
})
malkit.deleteManga(20, completionHandler: { (result, status, err) in
      //20 is manga_id
      //result is Bool
      //status is HTTPURLResponse
     //your process
})

Verify Credentials Sample

malkit.verifyCredentials(completionHandler: { (result, status, err) in
     //Check for MalKit().setUserData
     //result is Data(XML). You need to parse XML.
     //status is HTTPURLResponse
     //your process
})

Get User Anime or Manga List Data(This is not API)

malkit.userAnimeList { (result, http_status, err) in
     //Check for MalKit().setUserData
     //result is Data(XML). You need to parse XML.
     //status is HTTPURLResponse
     //your process
})
malkit.userMangaList { (result, http_status, err) in
     //Check for MalKit().setUserData
     //result is Data(XML). You need to parse XML.
     //status is HTTPURLResponse
     //your process
})

Install

Cartfile

github "nktn/MalKit"

carthage update

Podfile

pod 'MalKit'

pod install

Licence

MIT

Author

nktn

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.