Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hkashi73
Level 7

Issues loading from XML

Hello, New developer here not sure if this has been addressed before but I couldn't find anything on it. 

I downloaded the "Simple_Grid_and_Video" sample code that had a default sample feed on it. Obviously I need to change that feed to retrieve my content but everytime I change the feed from the default to anything else, all I get is a Loading... with the spinner. Even when I don't even change anything about the code and upload the default file right to my server, it still doesn't work. I haven't made any changes to the sample code just simply changing the url feed. Would appreciate any help. Thanks

For references I will place the debug console message below. 
Current Function:
058:  Function GetApiArray()
059:      url = CreateObject("roUrlTransfer")
060:      url.SetUrl("http://iranmovie.byethost4.com/media.rss")
061:      rsp = url.GetToString()
062:  
063:      responseXML = ParseXML(rsp)
064:*     responseXML = responseXML.GetChildElements()
065:      responseArray = responseXML.GetChildElements()
066:  
067:      result = []
068:  
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/source/main.brs(64)
064:     responseXML = responseXML.GetChildElements()
Backtrace:
#1  Function getapiarray() As Dynamic
   file/line: pkg:/source/main.brs(64)
#0  Function runuserinterface() As Void
   file/line: pkg:/source/main.brs(10)
Local Variables:
global           rotINTERFACE:ifGlobal
m                roAssociativeArray refcnt=3 count:0
url              bsc:roUrlTransfer refcnt=1
rsp              roString (2.1 was String) refcnt=1 val:"<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers("...
responsexml      Invalid
responsearray    <uninitialized>
result           <uninitialized>
xmlitem          <uninitialized>
itemaa           <uninitialized>
item             <uninitialized>
mediacontent     <uninitialized>
mediacontentitem <uninitialized>
0 Kudos
1 REPLY 1
EnTerr
Level 11

Re: Issues loading from XML

Brightscript Debugger> url = CreateObject("roUrlTransfer")
Brightscript Debugger> url.SetUrl("http://iranmovie.byethost4.com/media.rss")
Brightscript Debugger> rsp = url.GetToString()
Brightscript Debugger> ? rsp
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("7e9d1ade67c760d928698ef6dcb2fc8c");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://iranmovie.byethost4.com/media.rss?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>


your host does some funky javascript redirect junk and while that loads in a web browser, it ain't gonna fly with non-browser agents.
0 Kudos