Page 1 of 1

finding the redirect url from a java script redirect

Posted: Tue Sep 02, 2008 2:03 pm
by adhawk
Hello All,
I am trying extract the final url from a series of redirects (including some JavaScript redirects). I am bale to handle normal redirects by using the response code. I am struck with the JavaScript redirects as I am not able to extract the redirect url. Can you please let me know if there is any way to get the redirect urls from javascript redirects? (I am using a advertisement url as test case which redirects to different content providers some of them are javascript redirects)
-Thanks in advance

Re: finding the redirect url from a java script redirect

Posted: Tue Sep 02, 2008 2:22 pm
by andyhoneycutt
Are you parsing this out of a file/stream or are you actually trying to follow the redirects using something like cURL?

-Andy

Re: finding the redirect url from a java script redirect

Posted: Tue Sep 02, 2008 4:27 pm
by adhawk
I am using the PEAR package HTTP request to get the headers and body of a http request and parse the body for the redirect urls (or use the header location field for http respose codes > 300 & <399).
Thanks

Re: finding the redirect url from a java script redirect

Posted: Tue Sep 02, 2008 5:06 pm
by andyhoneycutt
Would you mind posting some code so I can play around with the problem from my end?