Crash-m / thelastripper

Automatically exported from code.google.com/p/thelastripper
0 stars 0 forks source link

smart radiostation field parsing #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a suggestion for an enhancement.

It would be great if the radio station field could automatically guess 
what you mean if you enter something that does not start with lastfm:// in 
the radiostation box. Examples:

"jazz" -> "lastfm://globaltags/jazz"
"jimi hendrix" -> "lastfm://artist/jimi+hendrix"

One way it could be implemented would be to execute a google search 
restricted to lastfm:

http://www.google.com/search?hl=en&q=site%3Alast.fm+%22jimi+hendrix%22
http://www.google.com/search?hl=en&q=site%3Alast.fm+%22jazz%22

The urls of the search results tell whether it is a tag or an artist. 
TheLastRipper could just pick the first result or present the user with a 
choice.

Original issue reported on code.google.com by grins...@gmail.com on 21 Aug 2007 at 10:28

GoogleCodeExporter commented 9 years ago
I'm pretty sure that Last.fm has some API's to do this... It might be 
implemented in
a future version...

But definitively a great idea...

I guess it could be implemented the same way Last-Exit has implemented it...

Original comment by jopsen@gmail.com on 21 Aug 2007 at 10:57

GoogleCodeExporter commented 9 years ago
Perhaps you could use the audioscrobbler webservices to achieve this...

You could request "http://ws.audioscrobbler.com/1.0/artist/jazz/similar.xml"
based on whether it gives a 404 or if the xml is really short then you can 
guess if 
it a tag or an artist.

Compare these examples:
Tag: http://ws.audioscrobbler.com/1.0/artist/jazz/similar.xml
Tag: http://ws.audioscrobbler.com/1.0/artist/rock/similar.xml
Tag: http://ws.audioscrobbler.com/1.0/artist/pop/similar.xml
Tag: http://ws.audioscrobbler.com/1.0/artist/60s/similar.xml
Tag: http://ws.audioscrobbler.com/1.0/artist/zimbabwe/similar.xml
Tag: http://ws.audioscrobbler.com/1.0/artist/nujazz/similar.xml

Artist: http://ws.audioscrobbler.com/1.0/artist/metallica/similar.xml
Artist: http://ws.audioscrobbler.com/1.0/artist/laila+kinnunen/similar.xml
Artist: http://ws.audioscrobbler.com/1.0/artist/erik+sumo/similar.xml
Artist: http://ws.audioscrobbler.com/1.0/artist/stateless/similar.xml

I think you can determine whether it is a tag or an artist by using the 
following 
rules to interpret the result of http://ws.audioscrobbler.com/1.0/artist/.... :
* 404 error:  it is a tag
* streamable=0: it is a tag
* number of artists in xml less than e.g. 5: it is a tag
* otherwise it is an artist.

-----
Some other suggestions:

You could also prefill the dropdown with the most popular tags:
Tag: http://ws.audioscrobbler.com/1.0/tag/toptags.xml

if text in the radiostation field matches one of the popular tags then you 
could 
avoid making a request to check if the user is thinking of an artist. Same 
thing 
with most popular artists. Also if the text matches one of the folder names in 
the 
download directory ... then it is an artist.

Original comment by grins...@gmail.com on 4 Oct 2007 at 10:07