Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [Not my release] Biography view (Read 492526 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Not my release] Biography view

Reply #750
the best thing to do is batch download all your album art in one go and then use the built-in artreader to display it. i don't see the point in using last.fm because the quality of most art is pretty bad. if you really want to use it as a source, album art downloader XUI supports it.

http://www.hydrogenaudio.org/forums/index....showtopic=57392

[Not my release] Biography view

Reply #751
It seems really iffy. Sometimes it will load instantly and sometimes it will take 30+ seconds on 40mb internet. I guess a better question is, is it possible to make it search my harddrive for album hard before searching lastfm? I assumed it would default to this but that doesn't seem to be the case and I don't see an option for it. Overall though, it's working great for me. I only had about 300 albums out of thousands that I had art scanned for so this really helps a lot even with the slow loading.

[Not my release] Biography view

Reply #752
I guess a better question is, is it possible to make it search my harddrive for album hard before searching lastfm? I assumed it would default to this but that doesn't seem to be the case and I don't see an option for it.


no. there are caching options though. i'm not sure if they're on by default or not. with it switched on, you obviously won't have any delay next time you listen to the album.

[Not my release] Biography view

Reply #753
I made a quick test about fetching album covers, works ok. but i can't recieve album info text from echonest, seems that this metod doesn't exist. So there is no point to have covers without text info...
It's easy to scratch album and bio text from last.fm web. Good question is why not use the web, instead echonest..
I test biography on echonest myself(i edited bio on last.fm) and found that this text on echonest is updated after 1 month.

[Not my release] Biography view

Reply #754
2. is it possible to make whis plugin automaticly save albumart in album playing folder?

Go to >Preferences, Tools, Biography Server, Last.fm,  then the Album tab
then in the image: space put this
$replace(%path%,%filename_ext%,)Albumart

My album folders already have a folder.jpg file, but my compilation folders don't have album art for each track.

With this code
Code: [Select]
$replace(%path%,%filename_ext%,)[%artist% - ][%album%]
you can populate compilation folders with "artist - album" covers. But the downside is that it will also create "artist - album" file where there is already a folder.jpg.

So, is there a hack so that it doesn't create a new file if folder.jpg already exists in the same folder?

[Not my release] Biography view

Reply #755
nope.

[Not my release] Biography view

Reply #756
Is it possible to make this not put half of words on a line? Like say a line ends in the word 'publication' on here it might show 'publi' and then when I scroll down on puts the entire word on the next line, can I just make it not end any line with half words and just put the entire word on the next line?

[Not my release] Biography view

Reply #757
have a look at the server preferences. i think you can add other sources.

I just saw this, something I've always wanted to do...but don't know how. Please Help. Thanks.

[Not my release] Biography view

Reply #758
have a look at the server preferences. i think you can add other sources.

I just saw this, something I've always wanted to do...but don't know how. Please Help. Thanks.


Try ex. this: http://www.hydrogenaud.io/forums/index.php...st&p=841216

Save text as: lastfm_bio.vbs
Text: ''ENTER YOUR FOLDER'' replace with your custom folder where to save biography text.
Put this file in foobar main folder.
In preferences>tools>biography server>run external script  -On ''command line'' write: cscript //U //nologo lastfm_bio.vbs "$meta(artist,0)"
Set character code to: UTF16.

Add ''run external script'' in source list, after last.fm.

Script use echonest.
Dont now if this still work, i don't use foo_uie_biography anymore.
Try..

[Not my release] Biography view

Reply #759
have a look at the server preferences. i think you can add other sources.

I just saw this, something I've always wanted to do...but don't know how. Please Help. Thanks.


Try ex. this: http://www.hydrogenaud.io/forums/index.php...st&p=841216

Save text as: lastfm_bio.vbs
Text: ''ENTER YOUR FOLDER'' replace with your custom folder where to save biography text.
Put this file in foobar main folder.
In preferences>tools>biography server>run external script  -On ''command line'' write: cscript //U //nologo lastfm_bio.vbs "$meta(artist,0)"
Set character code to: UTF16.

Add ''run external script'' in source list, after last.fm.

Script use echonest.
Dont now if this still work, i don't use foo_uie_biography anymore.
Try..


Thanks. I did as you instructed above. Nothing happens. Where ''ENTER YOUR FOLDER'', custom folder, is with or without quotes...?

[Not my release] Biography view

Reply #760
have a look at the server preferences. i think you can add other sources.

I just saw this, something I've always wanted to do...but don't know how. Please Help. Thanks.


Try ex. this: http://www.hydrogenaud.io/forums/index.php...st&p=841216

Save text as: lastfm_bio.vbs
Text: ''ENTER YOUR FOLDER'' replace with your custom folder where to save biography text.
Put this file in foobar main folder.
In preferences>tools>biography server>run external script  -On ''command line'' write: cscript //U //nologo lastfm_bio.vbs "$meta(artist,0)"
Set character code to: UTF16.

Add ''run external script'' in source list, after last.fm.

Script use echonest.
Dont now if this still work, i don't use foo_uie_biography anymore.
Try..


Thanks. I did as you instructed above. Nothing happens. Where ''ENTER YOUR FOLDER'', custom folder, is with or without quotes...?


With quotes, it looks like this: folder = "C:\foobar2000\biography"

It should work, i tested API it's ok.

Uups, sorry.
In tools>Biography Server: ''Run External Script'' should be first in list.
I tested with foo_uie_biography it works.

[Not my release] Biography view

Reply #761
have a look at the server preferences. i think you can add other sources.

I just saw this, something I've always wanted to do...but don't know how. Please Help. Thanks.


Try ex. this: http://www.hydrogenaud.io/forums/index.php...st&p=841216

Save text as: lastfm_bio.vbs
Text: ''ENTER YOUR FOLDER'' replace with your custom folder where to save biography text.
Put this file in foobar main folder.
In preferences>tools>biography server>run external script  -On ''command line'' write: cscript //U //nologo lastfm_bio.vbs "$meta(artist,0)"
Set character code to: UTF16.

Add ''run external script'' in source list, after last.fm.

Script use echonest.
Dont now if this still work, i don't use foo_uie_biography anymore.
Try..


Thanks. I did as you instructed above. Nothing happens. Where ''ENTER YOUR FOLDER'', custom folder, is with or without quotes...?


With quotes, it looks like this: folder = "C:\foobar2000\biography"

It should work, i tested API it's ok.

Uups, sorry.
In tools>Biography Server: ''Run External Script'' should be first in list.
I tested with foo_uie_biography it works.


OK, done as you said. I see the .txt  files in my custom folder, but I thought this info would show up in the BIO in Foobar...maybe this is not what I've been looking for...also, it only downloads artist info not album...thx again for your help and any suggestions you may offer.

[Not my release] Biography view

Reply #762
OK, done as you said. I see the .txt  files in my custom folder, but I thought this info would show up in the BIO in Foobar...maybe this is not what I've been looking for...also, it only downloads artist info not album...thx again for your help and any suggestions you may offer.


Well you didnt set something right. It shows text in foobar panel.
You have other scripts for album somewhere. Here: http://www.hydrogenaud.io/forums/index.php...0955&st=625
Ask Romor for help..

[Not my release] Biography view

Reply #763
OK, done as you said. I see the .txt  files in my custom folder, but I thought this info would show up in the BIO in Foobar...maybe this is not what I've been looking for...also, it only downloads artist info not album...thx again for your help and any suggestions you may offer.


Well you didnt set something right. It shows text in foobar panel.
You have other scripts for album somewhere. Here: http://www.hydrogenaud.io/forums/index.php...0955&st=625
Ask Romor for help..


OK, thanks mire777. It works now with the link you gave me to Romor's comments. Now I need to find a way to do this with album info...and thx again for all your help. Much appreciated.

[Not my release] Biography view

Reply #764
This is my script, I use it for some time, and works perfectly.
This is modified Romor's script. It hase future to save Bio.txt files, and display them later..
It first search for: last.fm bio, if not found > then search for Wikipedia bio, if not found > then display text(I don't like blank panel).
*You can enter your own text.
You must enter path location, where to save Bio.txt files.
THANKS ROMOR FOR THIS SCRIPT..





Code: [Select]
folder = "ENTER YOUR FOLDER"
On Error resume Next
With CreateObject("ADODB.Stream")
.Open
.Type = 2
.Charset = "utf-8"
.LoadFromFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
If Len(.Size) > 1 Then
WScript.Echo .ReadText
.Close
Else
.WriteText WScript.Arguments.Item(0)
.Flush
.Position = 0
.Type = 1
.Read = 3
For i = 1 To .Size-3
param = param & "%" & Hex(AscB(.Read(1)))
Next
.Close
Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = (("WIKIPEDIA:" & vbCrLf & vbCrLf)) & xml.selectSingleNode("/response/biographies/biography/text[../site='wikipedia']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio


Else

WScript.Echo "We can't find biography for this artist. Maybe your tags are incorrect or you lose internet connection. Please note that latest one tag ''artist'' must be corrected field.. If your tag is alredy properly field, that means that thoes artist is unknown, or you enter misspeled name. Also when you played radio stream, some station does not send information about artist, so this also causes problem." & vbCrLf & "Thank you for understending.." & vbCrLf & "For further information, and posible solution, check this site:" & vbCrLf & "http://www.hydrogenaudio.org/forums/index.php?showtopic=70955." & vbCrLf & "Your Foobar theam.."


End If
End If
End If
End If
End With


Hello again mire777. Do you have a similar script for album info...? The one for artist works just fine. Thanks

[Not my release] Biography view

Reply #765
This is my script, I use it for some time, and works perfectly.
This is modified Romor's script. It hase future to save Bio.txt files, and display them later..
It first search for: last.fm bio, if not found > then search for Wikipedia bio, if not found > then display text(I don't like blank panel).
*You can enter your own text.
You must enter path location, where to save Bio.txt files.
THANKS ROMOR FOR THIS SCRIPT..





Code: [Select]
folder = "ENTER YOUR FOLDER"
On Error resume Next
With CreateObject("ADODB.Stream")
.Open
.Type = 2
.Charset = "utf-8"
.LoadFromFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
If Len(.Size) > 1 Then
WScript.Echo .ReadText
.Close
Else
.WriteText WScript.Arguments.Item(0)
.Flush
.Position = 0
.Type = 1
.Read = 3
For i = 1 To .Size-3
param = param & "%" & Hex(AscB(.Read(1)))
Next
.Close
Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = (("WIKIPEDIA:" & vbCrLf & vbCrLf)) & xml.selectSingleNode("/response/biographies/biography/text[../site='wikipedia']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio


Else

WScript.Echo "We can't find biography for this artist. Maybe your tags are incorrect or you lose internet connection. Please note that latest one tag ''artist'' must be corrected field.. If your tag is alredy properly field, that means that thoes artist is unknown, or you enter misspeled name. Also when you played radio stream, some station does not send information about artist, so this also causes problem." & vbCrLf & "Thank you for understending.." & vbCrLf & "For further information, and posible solution, check this site:" & vbCrLf & "http://www.hydrogenaudio.org/forums/index.php?showtopic=70955." & vbCrLf & "Your Foobar theam.."


End If
End If
End If
End If
End With


Hello again mire777. Do you have a similar script for album info...? The one for artist works just fine. Thanks.

[Not my release] Biography view

Reply #766
This is my script, I use it for some time, and works perfectly.
This is modified Romor's script. It hase future to save Bio.txt files, and display them later..
It first search for: last.fm bio, if not found > then search for Wikipedia bio, if not found > then display text(I don't like blank panel).
*You can enter your own text.
You must enter path location, where to save Bio.txt files.
THANKS ROMOR FOR THIS SCRIPT..





Code: [Select]
folder = "ENTER YOUR FOLDER"
On Error resume Next
With CreateObject("ADODB.Stream")
.Open
.Type = 2
.Charset = "utf-8"
.LoadFromFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
If Len(.Size) > 1 Then
WScript.Echo .ReadText
.Close
Else
.WriteText WScript.Arguments.Item(0)
.Flush
.Position = 0
.Type = 1
.Read = 3
For i = 1 To .Size-3
param = param & "%" & Hex(AscB(.Read(1)))
Next
.Close
Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = xml.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio

Else

Set xml = CreateObject("MSXML2.DOMDocument.6.0") : xml.async = False
xml.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=OQMRCUVWC6PULGN2G&license=cc-by-sa&format=xml&name=" & param)
bio = (("WIKIPEDIA:" & vbCrLf & vbCrLf)) & xml.selectSingleNode("/response/biographies/biography/text[../site='wikipedia']").text
If Len(bio) Then
bio = Replace(Replace(bio, ".  ",  "." & vbCrLf & vbCrLf), ".  ",  "." & vbCrLf & vbCrLf)
.Open
.Type = 2
.Position = 0
.Charset = "utf-8"
.WriteText bio
.SaveToFile folder & "\" & WScript.Arguments.Item(0) & ".txt"
.Close
WScript.Echo bio


Else

WScript.Echo "We can't find biography for this artist. Maybe your tags are incorrect or you lose internet connection. Please note that latest one tag ''artist'' must be corrected field.. If your tag is alredy properly field, that means that thoes artist is unknown, or you enter misspeled name. Also when you played radio stream, some station does not send information about artist, so this also causes problem." & vbCrLf & "Thank you for understending.." & vbCrLf & "For further information, and posible solution, check this site:" & vbCrLf & "http://www.hydrogenaudio.org/forums/index.php?showtopic=70955." & vbCrLf & "Your Foobar theam.."


End If
End If
End If
End If
End With


Hello again mire777. Do you have a similar script for album info...? The one for artist works just fine. Thanks.

[Not my release] Biography view

Reply #767
OK, done as you said. I see the .txt  files in my custom folder, but I thought this info would show up in the BIO in Foobar...maybe this is not what I've been looking for...also, it only downloads artist info not album...thx again for your help and any suggestions you may offer.


Well you didnt set something right. It shows text in foobar panel.
You have other scripts for album somewhere. Here: http://www.hydrogenaud.io/forums/index.php...0955&st=625
Ask Romor for help..


Everything works fine now. Just need to know if there is a similar script for additional album info...

[Not my release] Biography view

Reply #768
Hello again mire777. Do you have a similar script for album info...? The one for artist works just fine. Thanks.


Yes. Try this, script works with last.fm API. As i remmember, should be better than default - has more info.
Shows Album tracks also.

Code: [Select]
DisplayAlbumTracks = 1

Set ARG = WScript.Arguments

If ARG.Count <> 2 Then
  WScript.Echo "Usage: cscript //nologo lastfm_album.vbs ""%artist%"" ""%title%"""
  WScript.Quit()
Else
  If Arg(0) <> "?" And Arg(1) <> "?" Then
  LfmInfo ARG(0), ARG(1)
End If
End If

Function LfmInfo(artist, track)
  Set XML = CreateObject("MSXML2.DOMDocument.6.0")
  ws = "http://ws.audioscrobbler.com/2.0/?method="
  api = StrReverse("9c8f955632698c23323d4b2c7a77030") & Chr(100) : q = Chr(34)

  XML.loadXML(Request(ws & "track.getinfo&api_key=" &_
  api & "&artist=" & artist & "&track=" & track))
  Set X = XML.selectSingleNode("lfm/track/album/title")
    If Not X Is Nothing Then album = X.text : rel = "Artist: " & q & artist & q & vbCrLf & "Album: " & q & album & q & vbCrLf End If
  Set X = XML.selectSingleNode("lfm/track/mbid")
    If Not X Is Nothing Then track_mbid = X.text End If
  Set X = XML.selectSingleNode("lfm/track/artist/mbid")
    If Not X Is Nothing Then artist_mbid = X.text End If


    If album <> "" Then
    XML.loadXML(Request(ws & "album.getinfo&api_key=" &_
    api & "&artist=" & artist & "&album=" & album))
    Set X = XML.selectSingleNode("lfm/album/mbid")
    If Not X Is Nothing Then album_mbid = X.text End If
    Set X = XML.selectSingleNode("lfm/album/releasedate")
    If Not X Is Nothing Then
      If X.text <> "" Then
        rel = Left(rel, Len(rel)-2) & vbCrLf & "Released on " & Mid(X.text, 1, InStr(X.text, ",")-1) & vbCrLf
      End If
      End If
    Set X = XML.selectSingleNode("lfm/album/wiki/content")
    If Not X Is Nothing Then
      If X.text <> "" Then rel = rel & vbCrLf & "ALBUM INFO:" & vbCrLf & DropHtml(X.text) & vbCrLf End If
     End If
     End If

  If DisplayAlbumTracks Then
    Set X = XML.selectNodes("lfm/album/tracks/track")
    If Not X Is Nothing Then
      For Each t In X
        If LCase(track) = LCase(t.selectSingleNode("name").text) Then p = "*" Else p = "  " End If
        trklst = trklst & p & Space(Len(t.getAttribute("rank")) mod 2) & t.getAttribute("rank") & ". " &_
        t.selectSingleNode("name").text & vbCrLf
      Next
    If trklst <> "" Then trklst = "ALBUM TRACKLIST: " & vbCrLf & trklst End If
    End If
    End If

  If DisplayAlbumTracks Then rel = rel & vbCrLf & trklst End If
  WScript.Echo "" & rel

End Function

Function DropHtml(s)
  Set HTML = CreateObject("HtmlFile")
  HTML.write s
  DropHtml = HTML.body.innerText
End Function

Function Request(url)
  Set HTTP = CreateObject("MSXML2.ServerXMLHTTP")
  HTTP.open "GET", url, 0
  HTTP.send ""
  If Err.number <> 0 then
   WScript.Echo "Error: " & HTTP.parseError.url & vbCrLf & HTTP.parseError.Reason
   WScript.Quit()
End If
  Request = HTTP.responseText
End Function


Save this as ''lastfm_album.vbs''.
Put script in main foobar folder.

Go to Preferences>tools>Run External Script>Album
On Command line enter this text:

cscript //nologo lastfm_album.vbs "%artist%" "%title%"

Set Character Code to: utf8
Click ''Add New'' > Apply.

In Preferences>Tools>Biography server
''Run External Script'' should be first in list.

I can't test this, i'm on work now.
So, Try it yourself.

[Not my release] Biography view

Reply #769
Hello again mire777. Do you have a similar script for album info...? The one for artist works just fine. Thanks.


Yes. Try this, script works with last.fm API. As i remmember, should be better than default - has more info.
Shows Album tracks also.

Code: [Select]
DisplayAlbumTracks = 1

Set ARG = WScript.Arguments

If ARG.Count <> 2 Then
  WScript.Echo "Usage: cscript //nologo lastfm_album.vbs ""%artist%"" ""%title%"""
  WScript.Quit()
Else
  If Arg(0) <> "?" And Arg(1) <> "?" Then
  LfmInfo ARG(0), ARG(1)
End If
End If

Function LfmInfo(artist, track)
  Set XML = CreateObject("MSXML2.DOMDocument.6.0")
  ws = "http://ws.audioscrobbler.com/2.0/?method="
  api = StrReverse("9c8f955632698c23323d4b2c7a77030") & Chr(100) : q = Chr(34)

  XML.loadXML(Request(ws & "track.getinfo&api_key=" &_
  api & "&artist=" & artist & "&track=" & track))
  Set X = XML.selectSingleNode("lfm/track/album/title")
    If Not X Is Nothing Then album = X.text : rel = "Artist: " & q & artist & q & vbCrLf & "Album: " & q & album & q & vbCrLf End If
  Set X = XML.selectSingleNode("lfm/track/mbid")
    If Not X Is Nothing Then track_mbid = X.text End If
  Set X = XML.selectSingleNode("lfm/track/artist/mbid")
    If Not X Is Nothing Then artist_mbid = X.text End If


    If album <> "" Then
    XML.loadXML(Request(ws & "album.getinfo&api_key=" &_
    api & "&artist=" & artist & "&album=" & album))
    Set X = XML.selectSingleNode("lfm/album/mbid")
    If Not X Is Nothing Then album_mbid = X.text End If
    Set X = XML.selectSingleNode("lfm/album/releasedate")
    If Not X Is Nothing Then
      If X.text <> "" Then
        rel = Left(rel, Len(rel)-2) & vbCrLf & "Released on " & Mid(X.text, 1, InStr(X.text, ",")-1) & vbCrLf
      End If
      End If
    Set X = XML.selectSingleNode("lfm/album/wiki/content")
    If Not X Is Nothing Then
      If X.text <> "" Then rel = rel & vbCrLf & "ALBUM INFO:" & vbCrLf & DropHtml(X.text) & vbCrLf End If
     End If
     End If

  If DisplayAlbumTracks Then
    Set X = XML.selectNodes("lfm/album/tracks/track")
    If Not X Is Nothing Then
      For Each t In X
        If LCase(track) = LCase(t.selectSingleNode("name").text) Then p = "*" Else p = "  " End If
        trklst = trklst & p & Space(Len(t.getAttribute("rank")) mod 2) & t.getAttribute("rank") & ". " &_
        t.selectSingleNode("name").text & vbCrLf
      Next
    If trklst <> "" Then trklst = "ALBUM TRACKLIST: " & vbCrLf & trklst End If
    End If
    End If

  If DisplayAlbumTracks Then rel = rel & vbCrLf & trklst End If
  WScript.Echo "" & rel

End Function

Function DropHtml(s)
  Set HTML = CreateObject("HtmlFile")
  HTML.write s
  DropHtml = HTML.body.innerText
End Function

Function Request(url)
  Set HTTP = CreateObject("MSXML2.ServerXMLHTTP")
  HTTP.open "GET", url, 0
  HTTP.send ""
  If Err.number <> 0 then
   WScript.Echo "Error: " & HTTP.parseError.url & vbCrLf & HTTP.parseError.Reason
   WScript.Quit()
End If
  Request = HTTP.responseText
End Function


Save this as ''lastfm_album.vbs''.
Put script in main foobar folder.

Go to Preferences>tools>Run External Script>Album
On Command line enter this text:

cscript //nologo lastfm_album.vbs "%artist%" "%title%"

Set Character Code to: utf8
Click ''Add New'' > Apply.

In Preferences>Tools>Biography server
''Run External Script'' should be first in list.

I can't test this, i'm on work now.
So, Try it yourself.


Many thanks, however, I'm getting the following error: "Cscript error: execution of the Windows script host failed. (Not enough storage is available to complete this operation.)" Please advise...

Edit: Got it working now, but it's showing the wrong album in almost every track I play. Also in some it just gives the album name and tracks and nothing more...

Edit: This not entirely true...it takes more than 15 secs. to show the album info, and it will only show the right info when the 2nd track is played. Also, the track names have to be exactly as they appear on the album. If I had a comment in brackets beside the track name, then the script can't find the album...it seems this boils down to a tagging issue, but the 2nd track thing must be something in the script...

[Not my release] Biography view

Reply #770
Many thanks, however, I'm getting the following error: "Cscript error: execution of the Windows script host failed. (Not enough storage is available to complete this operation.)" Please advise...

Edit: Got it working now, but it's showing the wrong album in almost every track I play. Also in some it just gives the album name and tracks and nothing more...

Edit: This not entirely true...it takes more than 15 secs. to show the album info, and it will only show the right info when the 2nd track is played. Also, the track names have to be exactly as they appear on the album. If I had a comment in brackets beside the track name, then the script can't find the album...it seems this boils down to a tagging issue, but the 2nd track thing must be something in the script...


Script check for albums by %artist% %track%.
On command line write this: cscript //nologo lastfm_album.vbs "%artist%" "%album%"
If you have problem with track names, this is problem by you> But if you have correctly tagged %album% field it will show exactly album then.
If on last.fm you don't have text for this album then it will only show tracks.
2nd track thing is probably problem with foo_uie_biography itself not in script(slow internet acces etc.. , or something not set right), because i always receive album info i cant reproduce this behavior..

[Not my release] Biography view

Reply #771
Many thanks, however, I'm getting the following error: "Cscript error: execution of the Windows script host failed. (Not enough storage is available to complete this operation.)" Please advise...

Edit: Got it working now, but it's showing the wrong album in almost every track I play. Also in some it just gives the album name and tracks and nothing more...

Edit: This not entirely true...it takes more than 15 secs. to show the album info, and it will only show the right info when the 2nd track is played. Also, the track names have to be exactly as they appear on the album. If I had a comment in brackets beside the track name, then the script can't find the album...it seems this boils down to a tagging issue, but the 2nd track thing must be something in the script...


Script check for albums by %artist% %track%.
On command line write this: cscript //nologo lastfm_album.vbs "%artist%" "%album%"
If you have problem with track names, this is problem by you> But if you have correctly tagged %album% field it will show exactly album then.
If on last.fm you don't have text for this album then it will only show tracks.
2nd track thing is probably problem with foo_uie_biography itself not in script(slow internet acces etc.. , or something not set right), because i always receive album info i cant reproduce this behavior..


Ok, thx. "Script check for albums by %artist% %track%". -here, am I supposed to replace certain line(s) in the script...?

[Not my release] Biography view

Reply #772
Many thanks, however, I'm getting the following error: "Cscript error: execution of the Windows script host failed. (Not enough storage is available to complete this operation.)" Please advise...

Edit: Got it working now, but it's showing the wrong album in almost every track I play. Also in some it just gives the album name and tracks and nothing more...

Edit: This not entirely true...it takes more than 15 secs. to show the album info, and it will only show the right info when the 2nd track is played. Also, the track names have to be exactly as they appear on the album. If I had a comment in brackets beside the track name, then the script can't find the album...it seems this boils down to a tagging issue, but the 2nd track thing must be something in the script...


Script check for albums by %artist% %track%.
On command line write this: cscript //nologo lastfm_album.vbs "%artist%" "%album%"
If you have problem with track names, this is problem by you> But if you have correctly tagged %album% field it will show exactly album then.
If on last.fm you don't have text for this album then it will only show tracks.
2nd track thing is probably problem with foo_uie_biography itself not in script(slow internet acces etc.. , or something not set right), because i always receive album info i cant reproduce this behavior..


Ok, thx. "Script check for albums by %artist% %track%". -here, am I supposed to replace certain line(s) in the script...?


Please disregard my comment above. Thx

[Not my release] Biography view

Reply #773
Many thanks, however, I'm getting the following error: "Cscript error: execution of the Windows script host failed. (Not enough storage is available to complete this operation.)" Please advise...

Edit: Got it working now, but it's showing the wrong album in almost every track I play. Also in some it just gives the album name and tracks and nothing more...

Edit: This not entirely true...it takes more than 15 secs. to show the album info, and it will only show the right info when the 2nd track is played. Also, the track names have to be exactly as they appear on the album. If I had a comment in brackets beside the track name, then the script can't find the album...it seems this boils down to a tagging issue, but the 2nd track thing must be something in the script...


Script check for albums by %artist% %track%.
On command line write this: cscript //nologo lastfm_album.vbs "%artist%" "%album%"
If you have problem with track names, this is problem by you> But if you have correctly tagged %album% field it will show exactly album then.
If on last.fm you don't have text for this album then it will only show tracks.
2nd track thing is probably problem with foo_uie_biography itself not in script(slow internet acces etc.. , or something not set right), because i always receive album info i cant reproduce this behavior..


Ok, thx. "Script check for albums by %artist% %track%". -here, am I supposed to replace certain line(s) in the script...?


Please disregard my comment above. Thx


No change with your suggestions above. Still returning the wrong album...seems to me,  the script is still looking first at the track, then looking for the first album it finds the track in. So, it return  "Compilations", or "Greatest Hits", or "The Best of...", etc. where it finds the track, but it's hardly ever the album I have in the tag...also, obviously if the next track is not in the previous album it returns the next album it finds, but never the one in the tag, with a few exceptions of course, those being albums whose artists don't have "Compilations," or "Best of..." etc...

[Not my release] Biography view

Reply #774
No change with your suggestions above. Still returning the wrong album...seems to me,  the script is still looking first at the track, then looking for the first album it finds the track in. So, it return  "Compilations", or "Greatest Hits", or "The Best of...", etc. where it finds the track, but it's hardly ever the album I have in the tag...also, obviously if the next track is not in the previous album it returns the next album it finds, but never the one in the tag, with a few exceptions of course, those being albums whose artists don't have "Compilations," or "Best of..." etc...


Ok seems that this metod not work for you, and it's waste of time to modify script.
So try this: http://pastebin.com/a5s7PSNn

Save text as: allmusic.vbs
Put file in main foobar folder.
Set character code(ANSI) - (if you later get a problem with some text characters, change this to UTF8 or UTF16)
On command line write this: cscript //nologo allmusic.vbs "%album artist%" "%album%" review|bio

This is Romor's script that can be used to display artist biography and album review according to allmusic.com