jikan icon indicating copy to clipboard operation
jikan copied to clipboard

Industry News

Open irfan-dahir opened this issue 1 year ago • 1 comments

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

To do

  • [x] getRecentNews
  • [x] getNewsByTag
  • [x] getNewsSearch
  • [x] getNewsTags
  • [ ] getNews
  • [ ] Unit Tests

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.

irfan-dahir avatar Feb 01 '24 12:02 irfan-dahir

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.

github-actions[bot] avatar May 05 '24 00:05 github-actions[bot]