Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
1,510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.99 KB | None | 0 0
  1.     On Error Resume Next
  2.     Set xmlDoc = CreateObject("Msxml2.XMLHTTP.6.0")
  3.     Dim cur_playing
  4.     Dim base64pw
  5.     base64pw = "OnBhc3N3b3Jk" '":password" in base64
  6.    
  7.     Do
  8.         xmlDoc.Open "GET","http://localhost:8080/requests/status.xml", false, "", "password"
  9.         xmlDoc.setRequestHeader "Authorization", "Basic "& base64pw
  10.         xmlDoc.send()
  11.        
  12.         cur_playing = Null
  13.         cur_playing = xmlDoc.responseXML.selectSingleNode("root/information/category/info[@name = 'now_playing']").text
  14.        
  15.         If IsEmpty(cur_playing) Or IsNull(cur_playing) Then
  16.             cur_playing = xmlDoc.responseXML.selectSingleNode("root/information/category/info[@name = 'artist']").text _
  17.             & " - " & _
  18.             xmlDoc.responseXML.selectSingleNode("root/information/category/info[@name = 'title']").text
  19.         End If
  20.        
  21.         Set objFSO=CreateObject("Scripting.FileSystemObject")
  22.         Set objFile = objFSO.CreateTextFile("nowplaying.txt",2)  'txt file must be ANSI
  23.         objFile.Write cur_playing & vbCrLf
  24.         objFile.Close
  25.        
  26.         WScript.Sleep 5000
  27.            
  28.     Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement