/lastfm_bio.vbs Secret
Last active
December 13, 2015 23:59
Star
You must be signed in to star a gist
Full lasf.fm bio script for foobar2000 Biography View
This file contains 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