0
votes

I try to create a perl tool for processing tweets with regex. My problem is that I can not retrieve tweets from the update to version 1.1 in the twitter API

Here is the error that the terminal returns :

Can't locate Net/Twitter/Role/API/RESTv1_1.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/share/perl5/Module/Runtime.pm line 205

I use this documentation :

https://metacpan.org/module/MMIMS/Net-Twitter-4.00003/lib/Net/Twitter/Manual/MigratingToV1_1.pod#Include-the-API::RESTv1_1-trait

Here is my code :

#!/usr/bin/perl -w

use Net::Twitter;
use Scalar::Util 'blessed';
use Data::Dumper;


my $nt = Net::Twitter->new(
  traits              => [qw/API::RESTv1_1/],
  consumer_key        => "my_key1",
  consumer_secret     => "my_key2",
  access_token        => "my_key3",
  access_token_secret => "my_key4",
 );

 my @t = $nt->search('hello');
 print Dumper @t;

Can you help me ? What did I do wrong ? Thanks, F.

1
What version of Net::Twitter is installed? run this and show output please find / -name RESTv1_1.pm and cpan -D Net::Twitter - Suic

1 Answers

0
votes

Probably because you have an old version of Net::Twitter installed. Support for API1.1 was added in version 4.0.