Bug#882390: libnet-twitter-perl: tweets are truncated to 140 characters

Vincent Lefevre vincent at vinc17.net
Sat Nov 25 01:47:16 UTC 2017


Control: retitle -1 libnet-twitter-perl: please document how to get extended tweets
Control: tags -1 - unreproducible

On 2017-11-24 23:21:56 +0100, gregor herrmann wrote:
> True but we might still fix the 140 character issue.
> 
> Except that I see no mention of "140" in the code (only in the POD)?!
> The update method seems to just POST to statuses/update, and that's
> it.

I'm not talking about the "update" method, but tweets that are read,
e.g. via user_timeline. The limit of 140 characters comes from Twitter,
with the old API. However, after searching a bit, I've found that it
doesn't need any code change. The POD documentation is just misleading
(one has the impression that it gives all the parameters that are
accepted) and incomplete with the current API.

According to

  https://developer.twitter.com/en/docs/tweets/tweet-updates

one needs the "Extended" mode for REST APIs.

For user_timeline, the documentation is:

       user_timeline
           Parameters: user_id, screen_name, since_id, max_id, count,
           trim_user, exclude_replies, include_rts, contributor_details
           Required: none
[...]

It should add the "tweet_mode" parameter, and say that it can be
set to "extended" for extended mode, and say that the tweet is
available in "full_text" instead of "text".

But since this applies to several methods, this could also be a
new section in the documentation. The initial example could also
be updated, by changing

             my $statuses = $nt->friends_timeline({ since_id => $high_water, count => 100 });
             for my $status ( @$statuses ) {
                 print "$status->{created_at} <$status->{user}{screen_name}> $status->{text}\n";

to

             my $statuses = $nt->friends_timeline({ since_id => $high_water, count => 100, tweet_mode => 'extended' });
             for my $status ( @$statuses ) {
                 print "$status->{created_at} <$status->{user}{screen_name}> $status->{full_text}\n";

(not tried on this particular example, but this worked in my scripts
for home_timeline and user_timeline).

BTW, the URL's to the API documentation are obsolete, so that this
didn't help at the beginning.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



More information about the pkg-perl-maintainers mailing list