Artist TOP TRACKS via last.fm (v1.10c) MM 2.5

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

But there is one problem that i think happens due to the natural way that Last.fm handles these url and that is that you can't use + in a bands name, atm just +44 comes into my mind that has a + in it, but even using url encode this gets interpreted as " 44" by last.fm and thus making it impossible to get any data for the band.

If anyone got an idea of a workaround please tell me :)
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

When calling Last.Fm I use this fix function (written by psyxonova in his ScrobblerDJ script)...

Code: Select all

Function fixurl(sRawURL)
  Const sValidChars = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\/&:"
  Const sEscapeChars = "\/&:"
  
  If Len(sRawURL) > 0 Then
    Dim iLoop : iLoop = 1
    Do While iLoop < Len(sRawURL)+1
      Dim sTmp : sTmp = Mid(sRawURL, iLoop, 1)
      If InStr(1,sValidChars,sTmp,0) = 0 Then
        sTmp = Hex(Asc(sTmp))
        If sTmp = "20" Then
          sTmp = "+"
        ElseIf Len(sTmp) = 1 Then
          sTmp = "%0"&sTmp
        Else
          sTmp = "%"&sTmp
        End If
      ElseIf InStr(1,sEscapeChars,sTmp,0) > 0 Then
        Select Case sTmp
          Case "&"
            sTmp = "%2526"
          Case "/"
            sTmp = "%252F"
          Case "\"
            sTmp = "%5C"
          Case ":"
            sTmp = "%3A"
        End Select
      End If
      fixurl = fixurl & sTmp
      iLoop = iLoop +1
    Loop
  End If
End Function
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Thanks but that is the same as URLEncode from scrobblerdj whih we already use :)
Thx tho ;)
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

I've never found any problems with this - what is the exact URL that isn't working?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Artist +44

http://ws.audioscrobbler.com/1.0/artist ... tracks.xml <-is what gets interpreted as
artist " 44"

and also if i use
http://ws.audioscrobbler.com/1.0/artist ... tracks.xml
also gets interpreted as
" 44"
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Hmmm. I'm stumped! :-?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

You have to double encode because it's being pushed through two layers, like this...

+44 -> %2B44 -> %252B44

The second encoding encodes the % so that it goes through the first layer and onto the second layer.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
tinny
Posts: 39
Joined: Tue Oct 03, 2006 5:30 am
Contact:

Post by tinny »

Thanks Teknojnky, great script and excellent idea :wink:
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Glad you like it! I'm quite enjoying it myself! 8)

Much thanks to Psyxonova for his work on scrobblerDJ, and to RedX, Trix, and all the other scripters who share their ideas, help on code and scripts!
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

@ trix: thx it fixed it 8)

new version available in my ftp: v1.02 HERE!
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

New version 1.03: HERE!
icon 1: ICON 1 icon 2: ICON 2

This release also include two icons that need to be in the same folder as the script (auto folder). If you don't copy them then u'll get two identical icons in the toolbar.

changelog:
1.03
* Added option panel for comfort setup
* Added another button to toolbar for easy selection between shuffle and normal
* Added status bar
* started working on future auto enqueue
* Added two custom icons
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Hi!

New version out 1.05 it now supports mutiple artists selection.

Grab it HERE

When multiple artists are selected if you use the option ordered it will only return the top songs of the first artist selected since it is in order, but if you use the shuffle option it will return a mix of the songs of the selected artists.

If anyone needs i can change the options and make it return the top X from each artist.

Regards,
Red
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

I've just rewritten the "fixurl" function I got from psyxonova, just thought you might like to know...

http://www.mediamonkey.com/forum/viewtopic.php?t=17433
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

NEW VERSION 1.06

Uses the improved fixurl by Trixmoto and now should be able to handle any artist.

grab it HERE
cadmanmeg
Posts: 309
Joined: Sun Nov 19, 2006 5:28 am

Post by cadmanmeg »

So I downloaded the current version and saved that vbs file into my auto scripts folder under MM, but I get no toolbar or no way to use the script. Am I doing something wrong? I restarted MM, but still nothing to identify how to use or enable it. I am sure it is somethign I am over looking, just do not know what that is. Any help? Thanks much.
Post Reply