Beefy Boxes and Bandwidth Generously Provided by pair Networks
Ovid Keep It Simple, Stupid  Not an array reference Twitter API
by neelakash21 (Initiate) on Sep 12, 2012 at 21:01 UTC
( #993315=perlquestion: print w/ replies, xml ) Need Help??
neelakash21 has asked for the wisdom of the Perl Monks
concerning the following question:  use Net::Twitter; use
Scalar::Util 'blessed'; use Net::Twitter::Search; # When no
authentication is required: my $nt = Net::Twitter->new(legacy =>
0); $consumer_key = "x"; $consumer_secret = "y"; $token = "z";
$token_secret = "w"; # As of 13-Aug-2010, Twitter requires OAuth
for authenticated requests my $nt = Net::Twitter->new( traits =>
[qw/OAuth API::REST/], consumer_key => $consumer_key,
consumer_secret => $consumer_secret, access_token => $token,
access_token_secret => $token_secret, ); my $twitter =
Net::Twitter::Search->new(); my $results =
$twitter->search('smoking'); foreach my $tweet (@{$results}) {
my $speaker = $tweet->{from_user}; my $text = $tweet->{text}; my
$time = $