Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAL Articles #491

Open
irfan-dahir opened this issue Oct 27, 2022 · 1 comment
Open

MAL Articles #491

irfan-dahir opened this issue Oct 27, 2022 · 1 comment
Assignees
Labels
feature request features that are requested or are in the roadmap
Milestone

Comments

@irfan-dahir
Copy link
Collaborator

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

$jikan->getArticleTags($request)

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

$jikan->getArticles(new ArticlesRequest(int $page))

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 implements Results and that work break it.

$jikan->getPinnedArticles(new ArticlesPinnedRequest())

Note: ArticlesPinnedRequest is the same as ArticlesRequest but without the pagination. Pinned articles are only on the first page.

Article By Tag

News By Tag: https://myanimelist.net/featured/tag/events

$jikan->getArticleByTag(new ArticleByTagRequest(string $tag, int $page))

Article Search

Article Search: https://myanimelist.net/featured/search?cat=featured&q=ghost+in+the+shell

$jikan->getArticleSearch(new ArticleSearchRequest(string $query, int $page))

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.

Property Type Remarks
mal_id String Tag name (canonical)
url String -
name String Tag 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

Property Type Remarks
mal_id String News ID
url String -
title String News title
subtitle String News subtitle
date String ISO8601
content String Unparsed HTML response (like user about mes'?)
user UserMeta Author user object
views Integer Comment count
relations Objects of MalUrl[] Same as relation is done in getAnime & getManga
related_articles Objects of ArticleListItem ⚠Kinda same property name as relations.
tags TagMeta[] Array of tag metadata objects (mal_id, name, URL)

Results

The following will implement Results.

  • Recent Articles
  • Article By Tag
  • Article Search

getResults() will return an array of ArticleListItem

ArticleListItem

Property Type Remarks
mal_id String News ID
url String -
images Images Object Need to look into available formats & sizes
title String News title
date String ISO8601
excerpt String -
user UserMeta Author user object
tags TagMeta[] Array of tag metadata objects (mal_id, name, URL)
is_spoiler Boolean Spoiler
is_advertorial Boolean Advertorial
views Integer View count
@irfan-dahir irfan-dahir added the feature request features that are requested or are in the roadmap label Oct 27, 2022
@irfan-dahir irfan-dahir pinned this issue Oct 27, 2022
@irfan-dahir irfan-dahir moved this to Planned in Jikan PHP API Oct 27, 2022
@irfan-dahir irfan-dahir changed the title Articles MAL Articles Oct 27, 2022
@irfan-dahir
Copy link
Collaborator Author

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

  • Date
  • Tags
  • Author
  • etc

This should further allow us to provide an even better API call experience for
Anime/Manga News rather than relying on parsing MAL.

@irfan-dahir irfan-dahir mentioned this issue Jul 21, 2023
5 tasks
@irfan-dahir irfan-dahir added this to the 5.0.0 milestone Jul 21, 2023
@irfan-dahir irfan-dahir moved this from Planned to In Progress in Jikan PHP API Feb 1, 2024
@irfan-dahir irfan-dahir mentioned this issue Feb 1, 2024
6 tasks
@irfan-dahir irfan-dahir self-assigned this Jun 1, 2024
@irfan-dahir irfan-dahir mentioned this issue Sep 21, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request features that are requested or are in the roadmap
Projects
Status: In Progress
Development

No branches or pull requests

1 participant