0

ツイートの返信を求めています。私はNet::Twitter::Liteを使っています:

my $nt = Net::Twitter::Lite->new(%consumer_tokens, %access_tokens, legacy_lists_api=>1);
my $mentions = $nt->mentions();
print Dumper $mentions;

しかし、その後、エラーが 1 つだけあります: OAuth で認証できませんでした。何か案は?

次のようなツイートを投稿 my $status = $nt->update({ status => 'some text' }); できますが、返信がありません。

アップデート

仕事:

#!/usr/bin/perl
use warnings;
use strict;
use Net::Twitter::Lite;
use Data::Dumper;

my %consumer_tokens = (
consumer_key    => 'xxxxxxxxxxxxxxxxxxxxxxxx',
consumer_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);
my %access_tokens=(
access_token => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
access_token_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);

my $nt = Net::Twitter::Lite->new(%consumer_tokens, %access_tokens, legacy_lists_api=>1);

#217932132083970049
my $status = $nt->update({ status => 'Happy Perl People!' });
print Dumper $status;

動作しない:

#!/usr/bin/perl
use warnings;
use strict;
use Net::Twitter::Lite;
use Data::Dumper;

my %consumer_tokens = (
consumer_key    => 'xxxxxxxxxxxxxxxxxxxxxxxx',
consumer_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);
my %access_tokens=(
access_token => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
access_token_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);

my $nt = Net::Twitter::Lite->new(%consumer_tokens, %access_tokens, legacy_lists_api=>1);

#217932132083970049
my $mentions = $nt->mentions();
print Dumper $mentions;
4

1 に答える 1

0

まず、APIを登録して情報を生成し、スクリプトを変更してリストします

use strict;
use warnings;
use Net::Twitter::Lite;

my $nt = Net::Twitter::Lite->new(
  consumer_key        => 'key_here', #first 
  consumer_secret     => 'consumer_secret_here', #
  access_token        => 'access_token', #second, generate token 
  access_token_secret =>  'access_token_secret', # 
  legacy_lists_api => 0,
);

my $result = eval { $nt->update('otra prueba') };

warn "$@\n" if $@;
于 2012-09-07T03:58:04.383 に答える