LastWave icon indicating copy to clipboard operation
LastWave copied to clipboard

Use wikipedia to generate genres

Open taurheim opened this issue 5 years ago • 0 comments

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

  1. Request https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&redirects&formatversion=2&titles=Books
  2. 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)
  3. 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?

taurheim avatar May 16 '19 17:05 taurheim