jikan-me / jikan

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

Industry News #543

Closed irfan-dahir closed 1 month ago

irfan-dahir commented 5 months ago

This implements 5 new API endpoints and refactors how the news parser works. Feature Tracker: #391

To do


getRecentNews

Description: Retrieves the latest news listing URL: https://myanimelist.net/news?p=1

API Request:

(new \Jikan\MyAnimeList\MalClient())
    ->getRecentNews(
        new \Jikan\Request\News\RecentNewsRequest(1)
    );

REST API Remarks: It would probably be best to use this method to loop through each ID, fetch their details via getNews and index/populate them directly into MongoDB/TypeSense. This would allow us to provide a better search experience.

getNewsByTag

Description: Retrieves news listing by tag URL: https://myanimelist.net/news/tag/new_anime

API Request:

(new \Jikan\MyAnimeList\MalClient())
    ->getNewsByTag(
        new \Jikan\Request\News\NewsByTagRequest('new_anime', 1)
    );

REST API Remarks: Won't need this scraper API call on the REST API because we'll have custom search.

getNewsSearch

Description: Retrieves news listing by query URL: https://myanimelist.net/news/search?q=bleach&p=1

API Request:

(new \Jikan\MyAnimeList\MalClient())
    ->getNewsSearch(
        new \Jikan\Request\Search\NewsSearchRequest('bleach', 1)
    );

REST API Remarks: Won't need this scraper API call on the REST API because we'll have custom search.

getNewsTags

Description: Retrieves all news tags and their respective types URL: https://myanimelist.net/news/tag

API Request:

(new \Jikan\MyAnimeList\MalClient())
    ->getNewsTags(
        new \Jikan\Request\News\NewsTagsRequest()
    );

REST API Remarks: Periodic sync and overwrite like we have for Anime and Manga Genres. There are 100+ entries and type available so we could paginate, provide basic name search (use case: auto completion), and type filter.

getNews

Description: Retrieves news resource URL: https://myanimelist.net/news/70500055

[!WARNING] Work in progress

API Request:

(new \Jikan\MyAnimeList\MalClient())
    ->getNews(
        new \Jikan\Request\News\News("70500055")
    );

REST API Remarks: We'll use a periodic sync strategy with getRecentNews to get all new entries in one go and keep the list updates.

github-actions[bot] commented 2 months ago

This pull request will be closed and archived in 18 days, as there has been no activity in the last 60 days. If this is still being worked on, please respond and we will re-open this pull request.