LastWave
LastWave copied to clipboard
Use wikipedia to generate genres
Wikipedia seems to have more consistently named genre tags, so instead of using last.fm's api, LastWave should probably use the wikipedia API:
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&formatversion=2&titles=The_Books|Julien_Baker
Possible regex: genre = (?:,? ?\[\[([^\]]*)\]\])*
Need to support
Genres with multiple names
Looks like sometimes the genre is written like this: [[experimental music|experimental]]
in which case we can probably take the last entry split by |
?
Disambiguation
In other cases there will need to be disambiguation support, e.g. https://en.wikipedia.org/wiki/Lotus -> https://en.wikipedia.org/wiki/Lotus_(American_band)
Finding the correct page
Find band: The Books
- Request https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&redirects&formatversion=2&titles=Books
- Notice that there's no genre, go to disambiguation page https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&redirects&formatversion=2&titles=Book_(disambiguation)
- Look for entries that include "band" or "musician"
Handle situations like https://en.wikipedia.org/wiki/John_Hopkins where the artists name is Jon Hopkins?