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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Postby RedX » Sun Mar 25, 2007 9:01 pm

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 :)
RedX
 
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Postby trixmoto » Mon Mar 26, 2007 3:40 am

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
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby RedX » Mon Mar 26, 2007 6:26 am

Thanks but that is the same as URLEncode from scrobblerdj whih we already use :)
Thx tho ;)
RedX
 
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Postby trixmoto » Mon Mar 26, 2007 10:58 am

I've never found any problems with this - what is the exact URL that isn't working?
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby RedX » Mon Mar 26, 2007 11:42 am

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"
RedX
 
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Postby trixmoto » Mon Mar 26, 2007 3:04 pm

Hmmm. I'm stumped! :-?
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby trixmoto » Tue Mar 27, 2007 8:59 am

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.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby tinny » Tue Mar 27, 2007 4:19 pm

Thanks Teknojnky, great script and excellent idea :wink:
tinny
 
Posts: 39
Joined: Tue Oct 03, 2006 5:30 am

Postby Teknojnky » Tue Mar 27, 2007 4:23 pm

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!
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby RedX » Tue Mar 27, 2007 5:23 pm

@ 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

Postby RedX » Wed Mar 28, 2007 1:12 pm

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

Postby RedX » Fri Apr 13, 2007 5:04 am

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
RedX
 
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Postby trixmoto » Tue May 01, 2007 4:07 am

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
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby RedX » Tue May 01, 2007 7:24 am

NEW VERSION 1.06

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

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

Postby cadmanmeg » Sun May 06, 2007 2:51 am

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.
cadmanmeg
 
Posts: 309
Joined: Sun Nov 19, 2006 5:28 am

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 7 guests