#!/usr/bin/perl -w

use strict;
use XML::RSS;
use LWP::Simple;
use LWP::UserAgent;
use utf8;
use Encode;

# create new instance of XML::RSS
my $rss = new XML::RSS;
my $ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
$ua = LWP::UserAgent->new( env_proxy => 1 );

my $rdf1 = new HTTP::Request GET => 'http://twitter.com/statuses/user_timeline/67265165.rss';
my $resRdf1 = $ua->request($rdf1);
if($resRdf1->is_success)
{
        $rss->parse($resRdf1->content);
}
else {die "Merde";}
my $i=0;
foreach my $item (@{$rss->{'items'}}) 
{
    exit if($i==5); 
    next unless defined($item->{'title'}) && defined($item->{'link'});
    $item->{'description'}=~/^itwars:\s(.*)/;
    print "<li&gt;'; 
    print encode("utf8","<a href=\"$item->{'link'}\" target=\"new\"&gt;$1</a&gt;\n");
    print "</li&gt;'; 
    $i++;
}