XKCDViewer/components/GetXKCDImage.xml

32 lines
775 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 = "GetXKCDImage" extends = "Task" >
<interface>
<field id = "imageuri" type = "string" />
<field id = "image" type = "string" />
</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()
uri = m.top.imageuri
data.setUrl(Left(uri, Len(uri) - 4) + "_2x.png")
data.GetToFile("tmp:/comic.png")
m.top.image = "tmp:/comic.png"
end sub
]]>
</script>
</component>