Kylart / MalScraper

Scrape everything you can from MyAnimeList.net
MIT License
177 stars 49 forks source link

[FEATURE] Adding of the recommendations page #45

Closed JustalK closed 3 years ago

JustalK commented 3 years ago

Hello,

I added the recommendations page with the function getRecommendationsList. Scrap of page like this : https://myanimelist.net/anime/269/Bleach/userrecs

    const data = await getRecommendationsList({ name: 'Bleach', id: 269});
    const dataNameOnly = await getRecommendationsList({ name: 'Bleach'});
[ {
...recommendation
},{
    pictureImage: 'https://cdn.myanimelist.net/r/50x70/images/anime/5/77300.jpg?s=f98a89321f158affc0c134cdbc972b41',
    animeLink: 'https://myanimelist.net/anime/10049/Nurarihyon_no_Mago__Sennen_Makyou',
    anime: 'Nurarihyon no Mago: Sennen Makyou',
    mainRecommendation: `Nurarihyon's Hagoromo Gitsune arc is eerily similar to Bleach's Soul Society arc. It starts with the a character getting kidnapped, the main character is forced to train in preparation of the inevitable invasion they need to do to get said character back. The invasion fails in case of the entrance so they need to improvise another plan to enter. With them traveling to retrieve their friend they get stronger in the process. The main character has to fight an enemy that only wishes to fight the stongest. At the end a character pulls an "Aizen" and all hell breaks loose.`,
    author: 'realKanoShuuya'
  },
{
...recommendations
}]

I added the tests inside the recommendation.test.js, the coverage is 100

I added the documentation for the call and the documentation for the response.

Let me know if some modifications need to be done.