-
-
Save rornor/aa2ada8bdc93144abd03 to your computer and use it in GitHub Desktop.
Full lasf.fm bio script for foobar2000 Biography View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version with text caching can be found here: https://gist.github.com/e8adee2d94cac17840b3