#/usr/bin/perl

use strict;
use warnings;
use Net::Twitter;
use Scalar::Util 'blessed';

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

my $tweet
    = 'Test for https://bugs.debian.org/882390 - what does Net::Twitter do with long messages? '
    . '0123456789' x 10;

my $result = $nt->update($tweet);

if ( my $err = $@ ) {
    die $@ unless blessed $err && $err->isa('Net::Twitter::Error');

    warn "HTTP Response Code: ", $err->code, "\n",
         "HTTP Message......: ", $err->message, "\n",
         "Twitter error.....: ", $err->error,   "\n";
}
