<?xml version="1.0" encoding="windows-1252"?>
<node id="787659" title="Re: Get redirected URL" created="2009-08-11 10:49:22" updated="2009-08-11 10:49:22">
<type id="11">
note</type>
<author id="168548">
LTjake</author>
<data>
<field name="doctext">
&lt;p&gt;c.f. requests_redirectable&lt;/p&gt;
&lt;code&gt;
use strict;
use warnings;

use LWP::UserAgent;

my $ua = LWP::UserAgent-&gt;new(
    requests_redirectable =&gt; [],
);

my $res = $ua-&gt;get( shift );
print $res-&gt;status_line, "\n", 'Location: ', $res-&gt;header( 'location' ), "\n";
__END__
bricas@bricas-laptop:~$ perl red.pl http://bit.ly/gf4h1
301 Moved
Location: http://github.com/rjbs/tpf-grant-history/blob/master/history.txt
&lt;/code&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-168548"&gt;
&lt;p&gt;--&lt;br&gt;"&lt;i&gt;No matter how much you push the envelope it'll still be stationary."&lt;/i&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
787356</field>
<field name="parent_node">
787356</field>
</data>
</node>
