On Tue, Dec 01, 2009 at 06:20:05AM -0800, Oreste wrote:
> I'm using Net::Twitter module which is working nicely. I'm getting
> back a lot of variables, I need to grab just those variables giving me
> the message and date. Could you help me to find them out?
> 
> This is the script I'm using:
> 
> use Net::Twitter;
> use Data::Dumper;
> my $nt = Net::Twitter->new(
> traits   => [qw/API::REST/],
> username => 'user',
> password => 'pass'
> );
> print Dumper $nt;

Your $nt is just the interface to the API.  If you want to, say, get the
latest status updates to your/your friends' accounts, you need to use
that interface to retrieve them:

my $timeline = $nt->friends_timeline;
for my $tweet (@$timeline) {
  print $tweet->{created_at} . ': ' . $tweet->{text};
}

(Code is untested, but should work.  Note that the maintainer of
Net::Twitter was talking a couple months ago about wrapping the
retrieved messages up into objects, so $tweet may no longer be a bare
hashref; I just haven't needed to update my direct Twitter-interfacing
functions since then so I haven't stayed on top of it.  Check the
Net::Twitter documentation for full details.)

-- 
Dave Sherohman

Reply via email to