Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuMarkn
Visitor

Re: Code to have Roku wait for redirection link

There's no need to post any code, just describe how it is doing the redirection in general terms.

Ok, I read your PM but I don't understand it, since you're not using terminology correctly.  "Sending a url to a JSON IDArray" doesn't make sense to me.  You're probably going to need to explain it here and answer questions about it.  In any case it sounds like what you're calling "redirection" is not using the HTTP 3xx redirection status codes.

--Mark
0 Kudos
matrixebiz
Roku Guru

Re: Code to have Roku wait for redirection link

Hi Mark, the full url link is pumped through a PHP script re-direction so must be different that the regular HTTP re-direction 
So what I need is the final destination page of text that you can see on the final landing page that I sent you in the PM which is "url" for the command below;
IDArray = getStreamId(url)

Let me know if you need more info.
0 Kudos
artesea
Visitor

Re: Code to have Roku wait for redirection link

"matrixebiz" wrote:
Hi Mark, the full url link is pumped through a PHP script re-direction so must be different that the regular HTTP re-direction 

A PHP redirection script should just use 30x headers to redirect, sounds like you are doing something else which is why Brightscript doesn't reach the final page.
You are either going to need to post an example URL showing what actually happens, or chunks of the PHP code for people to actually see what you are on about.
0 Kudos
RokuMarkn
Visitor

Re: Code to have Roku wait for redirection link

In the latest PM you sent me, you indicated that you have two ways to access your URL, http://URL1, and http://URL2?http://URL1, where the latter is using the script at URL2 to redirect to URL1.  If you download each of those URLs yourself in a browser and look at the source, you will see that the first one just returns a plain JSON string, while the second one returns an HTML page, with some Javascript and HTML markup around the JSON string, and the JSON string is HTML-encoded, with & replaced by &, etc.  If you want to extract and use the JSON string from the second result, you'll have to either parse it out of the HTML yourself and decode it, or change the server so that URL2 just returns the raw result of URL1 without wrapping it in HTML.

--Mark
0 Kudos
matrixebiz
Roku Guru

Re: Code to have Roku wait for redirection link

Okay, I think I can decode it but how do I parse it out of the HTML? Thx
0 Kudos
EnTerr
Roku Guru

Re: Code to have Roku wait for redirection link

<sigh> you need to know how to write PHP and do the re-direct there. No, i do not know nor care about PHP but just this once will illustrate (because i can use google, cue http://stackoverflow.com/questions/768431 , http://stackoverflow.com/questions/8469767 😞
<?php 
header('Location: ' . $_SERVER['QUERY_STRING']);
?>

Now, if you had the above script at URL2, then trying to load http://URL2?http://URL1 (per RokuMarkn's description) on Roku should "automaGically" return you the contents of URL1.

The purpose of the whole exercise eludes me however. It smells of something that a spam, malware or copyright circumvention artist would do - so respectfully, i am out of here.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.