[tpm] Searching Twitter

Antonio Sun antoniosun at lavabit.com
Sun May 29 05:14:01 PDT 2011


Hi,

How can I search within a Twitter channel?

I found the following code snip,

---------------------------------------------------------------
use Net::Twitter::Lite;

my $user = 'yourusername';
my $pass = '#########';
my $search_term = '#nomiki';

my $nt = Net::Twitter::Lite->new(
 username => $user,
 password => $password
);

my $r = $nt->search($search_term);
for my $status ( @{$r->{results}} ) {
   print "$status->{text}\n";
}
---------------------------------------------------------------

I haven't tried it, but have the following questions,

- I don't have a twitter account. Do I have to have a twitter account to
use Net::Twitter::Lite?
- Do I have to have a twitter account to search  twitter? (some forum does)
- The code doesn't seem to limit the search within a channel. how can I do
that?

All in all, how can I search within a Twitter channel in Perl?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110529/7f597056/attachment.html>


More information about the toronto-pm mailing list