Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Jan 10, 2019
1 parent 5cbf136 commit bc48999
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 34 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![JikanAuth](https://i.imgur.com/g4LT425.png)

# JikanAuth - Unofficial MyAnimeList.net PHP AUTH API
[![stable](https://img.shields.io/packagist/v/jikan-me/jikan.svg?style=flat)](https://packagist.org/packages/jikan-me/jikan) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Percentage of issues still open") [![stable](https://img.shields.io/badge/PHP-^%207.1-blue.svg?style=flat)]() [![Discord Server](https://img.shields.io/discord/460491088004907029.svg?style=flat&logo=discord)](https://discord.gg/4tvCr36)
[![stable](https://img.shields.io/packagist/v/jikan-me/jikan-auth.svg?style=flat)](https://packagist.org/packages/jikan-me/jikan-auth) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/jikan-me/jikan-auth.svg)](http://isitmaintained.com/project/jikan-me/jikan "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Percentage of issues still open") [![stable](https://img.shields.io/badge/PHP-^%207.1-blue.svg?style=flat)]() [![Discord Server](https://img.shields.io/discord/460491088004907029.svg?style=flat&logo=discord)](https://discord.gg/4tvCr36)


JikanAuth is a PHP API for [MyAnimeList.net](https://myanimelist.net). It allows you to login and manage your anime and manga lists. It satisfies MyAnimeList's lack of API.
Expand Down Expand Up @@ -42,7 +42,7 @@ The user's list can be updated through MyAnimeList's undocumented internal API w
### Does this mean Jikan can do XYZ too?
Yes, you can read messages, send messages, send friend requests, read notifcations, etc.

But I currently see no point in implementing these features because I currently don't see this being practical on a larger scale as a PHP library due to the **Reasons** I mentioned above.
But I see no point in implementing these features because I currently don't see this being practical on a larger scale as a PHP library due to the **Reasons** I mentioned above.


## Getting Started
Expand All @@ -62,6 +62,11 @@ But I currently see no point in implementing these features because I currently
- Delete
- Dependency Injection

## Todo
- Reuse session by storing it
- Add possible Exceptions
- Add possible responses (you don't get any response currently, it simply works)


## DISCLAIMER
- JikanAuth is not affiliated with MyAnimeList.net
Expand Down
22 changes: 10 additions & 12 deletions src/Client/MalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function login(LoginRequest $loginRequest)
if (empty($csrf)) {
throw new \Exception('CSRF token could not be scraped');
}

$this->csrfToken = $csrf[1];

var_dump($this->csrfToken);

$this->session = $response->getHeaderLine('Set-Cookie');
$loginRequest->setSession($response->getHeaderLine('Set-Cookie'));
Expand All @@ -53,34 +53,32 @@ public function addAnime(AnimeAddRequest $animeAddRequest)
$animeAddRequest->createRequest($this);
}

public function removeAnime(AnimeDeleteRequest $animeRemoveRequest)
public function editAnime(AnimeEditRequest $animeUpdateRequest)
{
$animeRemoveRequest->createRequest($this);
$animeUpdateRequest->createRequest($this);
}

public function updateAnime(AnimeEditRequest $animeUpdateRequest)
public function deleteAnime(AnimeDeleteRequest $animeRemoveRequest)
{
$animeUpdateRequest->createRequest($this);
$animeRemoveRequest->createRequest($this);
}


public function addManga(MangaAddRequest $mangaAddRequest)
{
$mangaAddRequest->createRequest($this);
}


public function removeManga(MangaDeleteRequest $mangaRemoveRequest)
public function editManga(MangaEditRequest $mangaUpdateRequest)
{
$mangaRemoveRequest->createRequest($this);
$mangaUpdateRequest->createRequest($this);
}


public function updateManga(MangaEditRequest $mangaUpdateRequest)
public function deleteManga(MangaDeleteRequest $mangaRemoveRequest)
{
$mangaUpdateRequest->createRequest($this);
$mangaRemoveRequest->createRequest($this);
}


/**
* @return mixed
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Request/Anime/AnimeAddRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ public function createRequest(MalClient $client)
]
]
);

var_dump($response->getStatusCode());
var_dump((string)$response->getBody());

}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/Request/Anime/AnimeDeleteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public function createRequest(MalClient $client)
]
]
);

var_dump($response->getStatusCode());
var_dump((string)$response->getBody());

}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/Request/Anime/AnimeEditRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ public function createRequest(MalClient $client)
]
]
);

var_dump($response->getStatusCode());
var_dump((string)$response->getBody());

}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/Request/Manga/MangaAddRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ public function createRequest(MalClient $client)
]
]
);

var_dump($response->getStatusCode());
var_dump((string)$response->getBody());

}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/Request/Manga/MangaDeleteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public function createRequest(MalClient $client)
]
]
);

var_dump($response->getStatusCode());
var_dump((string)$response->getBody());

}

/**
Expand Down

0 comments on commit bc48999

Please sign in to comment.