修改 tweet 对 origin 的调用是应用程序

modify tweet call for origin being the application

我目前已经构建了用于 post 发送推文的 Twitter 处理程序。不知不觉中,我为推文构建了来自授权用户的推文,而我们实际上想从我们的应用程序本身发推文。如何将此代码调整为 post on behalf of the application itself.

use Net::Twitter;
my $nt = Net::Twitter->new(
    traits   => [qw/OAuth API::RESTv1_1/],
    consumer_key => '',
    consumer_secret => '',
    access_token => '',
    access_token_secret => '',
);
my $result = $nt->update('Hello, world!');

当您以要发推文的帐户身份登录 Twitter 时,您需要重新生成授权令牌。