jikan-me / jikan

Unofficial MyAnimeList PHP+REST API which provides functions other than the official API
https://jikan.moe
MIT License
854 stars 94 forks source link

how to call review page? #485

Closed CodingBDX closed 1 year ago

CodingBDX commented 1 year ago

hello: i try to see, where i can review... I pass MalId into my url but after, i don't know, what request i can use ... thank for answer

irfan-dahir commented 1 year ago

Hi, please upgrade jikan-me/jikan to v4.

$reviews = $jikan->getReviews(
    new \Jikan\Request\Reviews\ReviewsRequest(
        \Jikan\Helper\Constants::MANGA, // type
        1, // page
        \Jikan\Helper\Constants::REVIEWS_SORT_MOST_VOTED, // sort
        true, // show spoilers
        true // show preliminary
    )
);

I will be closing this issue. Please join our discord server for any support queries on using the API, thanks! http://discord.jikan.moe/

CodingBDX commented 1 year ago

i try this, where you don't explain...wheere i pass $id? or $MalId??

i try this $showAnime = $apiAnime->getAnimeMoreInfo(new AnimeMoreInfoRequest($id));

     $getResult = $showAnime->getMoreInfo();
irfan-dahir commented 1 year ago

My bad - I used the wrong snippet. This is the one for Anime reviews where you can pass $malid:

$data = $jikan->getAnimeReviews(
    new \Jikan\Request\Anime\AnimeReviewsRequest(
        1, // MAL ID
        1, // page
        \Jikan\Helper\Constants::REVIEWS_SORT_MOST_VOTED, //sort
        true, // show spoilers
        false // show preliminary
        )
);

But for this to work, you must upgrade to v4 of the parser linked above.

I hope that helps. I can respond to queries more quickly on discord.

CodingBDX commented 1 year ago

thank for answer, i try to do and reformat your code

` $apiAnime = new MalClient();

     $data = $apiAnime->getAnimeReviews(
         new AnimeReviewsRequest(
             5114,
             1
         )
     );
     $result = $data->getResults();

     return $this->twig->render('Anime/show.html.twig', ['anime' => $result]);

`

and in my page i do, anime.getResults... but it's not work