Open irfan-dahir opened 1 year ago
Notes on REST API implementation for this and #391 .
Thinking about it, I believe it would be best to implement it like Anime or Manga is. Indexed within the DB and made available within Scout.
Otherwise using MAL's search for News and articles would be very limited. Custom queries would allow us to further filter by
This should further allow us to provide an even better API call experience for Anime/Manga News rather than relying on parsing MAL.
Definition/Requirement
"Featured articles" are a bit different than News.
News is user submitted. Whereas "Features articles" are written by MAL's editorial team and are usually more in content. There will be some differences in the model objects.
👉 We'll dropping the word "Featured" and calling them simply as "Articles" in Jikan,.
Endpoints
Article Tags
Article Tags: https://myanimelist.net/featured/tag
Categories are listed here in a similar manner to genre listing. So we can re-use the same parser here probably.
Recent Articles
Recent Articles: https://myanimelist.net/featured
Pinned Articles
Pinned Articles: https://myanimelist.net/featured
MAL pins/sets to feature usually 4 articles at the top of the same recent articles page. I don't want to return this in
getArticles
as it implementsResults
and that work break it.Note:
ArticlesPinnedRequest
is the same asArticlesRequest
but without the pagination. Pinned articles are only on the first page.Article By Tag
News By Tag: https://myanimelist.net/featured/tag/events
Article Search
Article Search: https://myanimelist.net/featured/search?cat=featured&q=ghost+in+the+shell
Response Objects
Tags
Unlike News, a category here is a Tag itself as there's no higher hierarchy. We'll simply re-use the same approach as genre listing. where a list of
MalUrl
is returned.mal_id
url
name
Could possibly re-use
TagMeta
from News as well.ArticleByID
MAL URL: https://myanimelist.net/featured/2380/Anime_Expo__Lookback_Special https://myanimelist.net/featured/2378/Ni_no_Kuni__Cross_Worlds_Global_Version_Release_on_the_Horizon https://myanimelist.net/featured/1087/The_Philosophy_Behind_Ghost_in_the_Shell
mal_id
url
title
subtitle
date
content
user
UserMeta
views
relations
MalUrl[]
getAnime
&getManga
related_articles
ArticleListItem
relations
.tags
Results
The following will implement Results.
getResults()
will return an array ofArticleListItem
ArticleListItem
mal_id
url
images
title
date
excerpt
user
UserMeta
tags
is_spoiler
is_advertorial
views