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

[Request] Character favorite counts on People endpoint #277

Open
purarue opened this issue Apr 8, 2020 · 1 comment
Open

[Request] Character favorite counts on People endpoint #277

purarue opened this issue Apr 8, 2020 · 1 comment
Labels
feature request features that are requested or are in the roadmap

Comments

@purarue
Copy link
Contributor

purarue commented Apr 8, 2020

An endpoint can be added to get the favorites for a person on MAL, by requesting the mobile version of the site.

could be put at person/id/favorites

heres a proof of concept:

import requests
from bs4 import BeautifulSoup
headers_mobile = { 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B137 Safari/601.1'}
resp = requests.get("https://myanimelist.net/people/5", headers=headers_mobile)
soup = BeautifulSoup(resp.text)
[{el.select('p[class^="va-slider-item"]')[0].text: el.find("span", attrs={"data-users": True})["data-users"]} for el in soup.select(".va-slider-item") if el.select('p[class^="va-slider-item"]')]

Output:

[{'Ash Roller': '61'},
 {'Ash Roller': '61'},
 {'Ash Roller': '61'},
 {'Ash Roller': '61'},
 {'Sora, Takeuchi': '76'},
 {'Sokabe': '1'},
 {'Sokabe': '1'},
 {'Ginshu': '8'},
 {'Cayenne, Suzushiro': '6'},
 {'Capensis': '10'},
 {'Teo': '0'},
 {'Kouichi, Yamano': '0'},
....
@irfan-dahir irfan-dahir added the feature request features that are requested or are in the roadmap label Apr 8, 2020
@purarue purarue changed the title [Request] People Character/Staff Favorites [Request] Character favorite counts on People endpoint Apr 8, 2020
@irfan-dahir irfan-dahir added this to the 3.0.0 milestone Apr 16, 2020
@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue will be closed and archived in 18 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.

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
None yet
Development

No branches or pull requests

2 participants