Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String from XML?
#25
here ya go sorry for the delay 

Function Function460
 
Code:
Copy      Help
str s1 s2 final
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest h._create
WinHttp.WinHttpRequest i._create
str enc.encrypt(4 ":vlcremote") ;;replace ":vlcremote" with your password, if no username
IXml x._create; IXml x1._create
IXmlNode attr attr1 attr2 attr3;
i.Open("GET" "http://127.0.0.1:8080/requests/status.xml")
i.setRequestHeader("content-type", "application/xml")
i.SetRequestHeader("Authorization", F"Basic {enc}")
i.Send()
err out _error.description; ret
if i.Status=200
,x1.FromString(i.ResponseText)
,attr3=x1.Path("root/time")
,if(attr3)
,,s1= attr3.Value
,h.Open("GET" "http://127.0.0.1:8080/requests/playlist.xml")
,h.setRequestHeader("content-type", "application/xml")
,h.SetRequestHeader("Authorization", F"Basic {enc}")
,h.Send()
,err out _error.description; ret
,if h.Status=200
,,x.FromString(h.ResponseText)
,,ARRAY(IXmlNode) a; 
,,x.Path(".//leaf" a)
,,for _i 0 a.len
,,,attr=a[_i].Attribute("uri")
,,,s2=attr.Value
,,,s2.escape(8);; remove url formatting showing true path
,,,s2.replacerx("file:///" "")
,,,attr2=a[_i].Attribute("current")
,,,if(attr2)
,,,,final=F"{s1},{s2}"
,,,,out final


Messages In This Thread
String from XML? - by pctechtv - 03-04-2022, 12:14 PM
RE: String from XML? - by Kevin - 03-04-2022, 04:33 PM
RE: String from XML? - by pctechtv - 03-06-2022, 05:51 AM
RE: String from XML? - by pctechtv - 03-06-2022, 09:34 AM
RE: String from XML? - by Kevin - 03-06-2022, 02:18 PM
RE: String from XML? - by pctechtv - 03-06-2022, 09:10 PM
RE: String from XML? - by Kevin - 03-09-2022, 02:57 PM
RE: String from XML? - by pctechtv - 03-12-2022, 02:41 PM
RE: String from XML? - by pctechtv - 05-23-2023, 04:29 AM
RE: String from XML? - by pctechtv - 05-23-2023, 12:51 PM
RE: String from XML? - by Kevin - 05-23-2023, 05:34 PM
RE: String from XML? - by pctechtv - 05-25-2023, 03:54 PM
RE: String from XML? - by Kevin - 05-27-2023, 12:08 PM
RE: String from XML? - by pctechtv - 06-07-2023, 04:22 PM
RE: String from XML? - by pctechtv - 06-10-2025, 12:36 AM
RE: String from XML? - by Gintaras - 06-10-2025, 07:32 AM
RE: String from XML? - by pctechtv - 06-10-2025, 07:20 PM
RE: String from XML? - by pctechtv - 06-11-2025, 02:30 AM
RE: String from XML? - by Kevin - 06-11-2025, 02:45 AM
RE: String from XML? - by pctechtv - 06-11-2025, 11:41 AM
RE: String from XML? - by Kevin - 06-11-2025, 12:09 PM
RE: String from XML? - by Kevin - 06-11-2025, 04:23 PM
RE: String from XML? - by pctechtv - 06-11-2025, 04:50 PM
RE: String from XML? - by pctechtv - 06-12-2025, 08:33 PM
RE: String from XML? - by Kevin - 06-17-2025, 02:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)