#882390 libnet-twitter-perl: please document how to get extended tweets

#882390#5
Date:
2017-11-22 01:43:54 UTC
From:
To:
Some time ago, Twitter has extended tweets to more than 140 characters.
But with Net::Twitter, tweets are truncated to 140 characters, and
even less (because they include a link to get the full tweet when this
occurs). This makes this module rather useless nowadays.

This module should be updated to the current Twitter API.

#882390#10
Date:
2017-11-24 12:04:49 UTC
From:
To:
Hi Vincent,

in https://github.com/semifor/Net-Twitter/issues/76 the upstream author
makes clear that he considers Net::Twitter a dead end and has deprecated
it in favour of Twitter::API. In fact, the git repo has added the
following notice:

    This module has been superseded by L<Twitter::API>. Please update as
    soon as you possibly can to use new features and the new API
    versions. This module will no longer be supported.

Unfortunately, Twitter::API doesn't seem to be packaged in Debian, and
its POD says "This in an alpha release. The interface may change." ...

Florian

#882390#15
Date:
2017-11-24 22:21:56 UTC
From:
To:
Control: tag -1 + unreproducible

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.

So let's try ...

*a bit later*

With the result of the attached script I got (no error, exit status
0, and): https://twitter.com/gregoa_/status/934184021684301824
(length 188 characters)


So I can't reproduce a 140 character limit in Net::Twitter.


Cheers,
gregor

#882390#22
Date:
2017-11-25 01:47:16 UTC
From:
To:
Control: retitle -1 libnet-twitter-perl: please document how to get extended tweets
Control: tags -1 - unreproducible

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.