0

Possible to retrieve redirected destination url?

I'm trying to use the YQL module in Y! Pipes to determine the ultimate destination redirected url.
Example:
http://feedproxy.google.com/~r/Techcrunch/~3/P-%5FqWQXyAPU/
redirects to
http://www.techcrunch.com/2009/12/08/build-it-with-me

Is there a simple way to get this information with YQL?

by
3 Replies
  • QUOTE (GollyJer @ Dec 29 2009, 02:30 PM) <{POST_SNAPBACK}>
    I'm trying to use the YQL module in Y! Pipes to determine the ultimate destination redirected url.
    Example:
    http://feedproxy.google.com/~r/Techcrunch/~3/P-%5FqWQXyAPU/
    redirects to
    http://www.techcrunch.com/2009/12/08/build-it-with-me

    Is there a simple way to get this information with YQL?


    If you use y.rest() to make the call you can use followRedirects(false) like this:

    use 'http://javarants.com/yql/javascript.xml' as j; select * from j where code='response.object = y.rest("http://feedproxy.google.com/~r/Techcrunch/~3/P-%5FqWQXyAPU/").followRedirects(false).get().headers.location;'

    Sam
    0
  • QUOTE (Sam @ Jan 4 2010, 09:57 AM) <{POST_SNAPBACK}>
    If you use y.rest() to make the call you can use followRedirects(false) like this:

    use 'http://javarants.com/yql/javascript.xml' as j; select * from j where code='response.object = y.rest("http://feedproxy.google.com/~r/Techcrunch/~3/P-%5FqWQXyAPU/").followRedirects(false).get().headers.location;'

    Sam

    Awesome. Thanks Sam.
    0
  • Hi
    I noticed that sometimes this query returns "undefined"

    Example:
    http://query.yahooapis.com/v1/public/yql?q=use%20'http%3A%2F%2Fjavarants.com%2Fyql%2Fjavascript.xml'%20as%20j%3B%20select%20*%20from%20j%20where%20code%3D'response.object%20%3D%20y.rest(%22http%3A%2F%2Fwww.google.com%2F%22).followRedirects(false).get().headers.location%3B'&diagnostics=true
     
    use 'http://javarants.com/yql/javascript.xml' as j; select * from j where code='response.object = y.rest("http://www.google.com/").followRedirects(false).get().headers.location;'
    Is threre any way to get direct url, no matter if it use redirect or not?
    0

Recent Posts

in YQL