secret
Last active

Full lasf.fm bio script for foobar2000 Biography View

  • Download Gist
lastfm_bio.vbs
Visual Basic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
On Error resume Next
With CreateObject("MSXML2.DOMDocument.6.0")
.async = false
.load("http://developer.echonest.com/api/v4/artist/biographies?api_key=PKDMY7Z0SGFBW" & UCase(Right("denial", 4)) & "&license=cc-by-sa&format=xml&name=" & UTF8Encode(WScript.Arguments.Item(0)))
WScript.Echo Replace(Replace(.selectSingleNode("/response/biographies/biography/text[../site='last.fm']").text, ". ", "." & vbCrLf & vbCrLf), ". ", "." & vbCrLf & vbCrLf)
End With
 
Function UTF8Encode(s)
With CreateObject("ADODB.Stream")
.Open
.Type = 2
.Charset = "utf-8"
.WriteText s
.Flush
.Position = 0
.Type = 1
.Read = 3
For i = 1 To .Size-3
UTF8Encode = UTF8Encode & "%" & Hex(AscB(.Read(1)))
Next
.Close
End With
End Function

Version with text caching can be found here: https://gist.github.com/e8adee2d94cac17840b3

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.