XKCDViewer/components/GetXKCDComic.xml

30 lines
741 B
XML
Raw Permalink Normal View History

2023-12-18 03:33:33 +00:00
<?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>