aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 10b7b48fad4f22a2e8de81a5a720823a1b82e1a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# MAL2Go
MyAnimeList V2 API wrapper for GoLang

## Installation
MAL2Go is divided into multiple packages. Each package needs to be installed manually.
In a terminal, run
``` fish
go get github.com/MikunoNaka/MAL2Go/anime
go get github.com/MikunoNaka/MAL2Go/manga
go get github.com/MikunoNaka/MAL2Go/user
go get github.com/MikunoNaka/MAL2Go/user/anime
go get github.com/MikunoNaka/MAL2Go/user/manga
```
To install the packages you'd usually need. To find out more about what each package does, refer to [Package Structure](#Package-Structure)

Go needs to be installed and `$GOPATH` should be set up

## Package Structure
[anime](anime) package
contains all the functionality for pulling data about anime from the API.

[manga](manga) package
contains all the functionality for pulling data about manga from the API.

[user](user) package
has the functionality for getting user data and updating information.

[user/animelist](user/anime) package
has the functionality to update the authenticated user's anime list status, etc.

[user/animelist](user/anime) package
has the functionality to update the authenticated user's manga list status, etc.

[util](util) package has some code used 
by multiple packages that I think don't belong particularly to one single package

[errhandlers](errhandlers) package
contains the validators and error handlers mainly to be used by MAL2Go.

## Authentication
MyAnimeList V2 API uses OAuth to authenticate a user.

Some useful links about authenticating with MyAnimeList:
- A Client ID can be generated [here](https://myanimelist.net/apiconfig).
This is needed to create an auth token for use with your program.

- Official documentation for authenticating with MyAnimeList is [here](https://myanimelist.net/apiconfig/references/authorization)

- An awesome guide to simplify this process by [ZeroCrystal](https://myanimelist.net/blog.php?eid=835707).

- An easy but not the best (still really good for getting started quickly/testing)
way to generate a token is to use [my script](https://github.com/MikunoNaka/mal-authtoken-generator).

Each package has a Client struct that needs an `AuthToken: string` among other (optional)
values that don't do anything yet. 

**NOTE:** I'm new to OAuth and might make changes to the Client struct in each package.

## Licence
Licenced under GNU General Public Licence

GNU GPL License: [LICENSE](LICENSE)

Copyright (c) 2022 Vidhu Kant Sharma