XKCDViewer/components/GetXKCDComic.xml
2023-12-17 21:33:51 -06:00

30 lines
No EOL
741 B
XML
Executable file

<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->
<component name = "GetXKCDComic" extends = "Task" >
<interface>
<field id = "comicid" type = "string" />
<field id = "comic" type = "assocarray" />
</interface>
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.functionName = "getcomic"
end sub
sub getcomic()
data = createObject("roUrlTransfer")
data.SetCertificatesFile("common:/certs/ca-bundle.crt")
data.InitClientCertificates()
data.setUrl("https://xkcd.com" + m.top.comicid + "/info.0.json")
m.top.comic = ParseJson(data.GetToString())
end sub
]]>
</script>
</component>