30 lines
741 B
XML
30 lines
741 B
XML
|
<?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>
|