Truncated message tweets

DaniloPF

Please!

I'm getting tweets from LinqToTwitter, and some tweets seem to have the text truncated, with part of the text following with an ellipsis. In some cases, the search criteria are not returned in the text, as it appears to be in the unearned part of the message. That's right? Is there a way to get this missing part of the message? I have already looked at other posts, but I could not understand which parameter allows the full text to be obtained. I'm using linqToTwitter version 4.1.0.

Thank you

 Dim twitterCtx As TwitterContext = New TwitterContext(twAuth)

 Dim Response As Search = Await (From search In twitterCtx.Search()
                                    Where search.Type = SearchType.Search _
                                    AndAlso search.SearchLanguage = "pt" _
                                    AndAlso search.Query = "Coronavirus").SingleOrDefaultAsync()

 Dim tweets As List(Of Status) = Response.Statuses()

 If Response IsNot Nothing AndAlso Response.Statuses IsNot Nothing Then
    For Each str As Status In tweets
        Console.WriteLine(str.StatusID.ToString() + " " + str.Text)
    Next
 End If
Joe Mayo

When Twitter extended tweets from 140 to 280 characters, they needed to add support in the API. This is called Extended Mode and you need to add a new filter to your LINQ query, like this:

Dim Response As Search = Await (From search In twitterCtx.Search()
                                Where search.Type = SearchType.Search _
                                AndAlso search.SearchLanguage = "pt" _
                                AndAlso search.TweetMode = TweetMode.Extended _
                                AndAlso search.Query = "Coronavirus").SingleOrDefaultAsync()

Notice the search.TweetMode property. I assigned the TweetMode.Extended enum to it, which means you now get the full 280 characters.

Having done that, you might view the Text property and be surprised to see Nothing. That's because now the tweet text is in the FullText property and you can read it like this:

Dim tweets As List(Of Status) = Response.Statuses()

If Response IsNot Nothing AndAlso Response.Statuses IsNot Nothing Then
    For Each str As Status In tweets
        Console.WriteLine(str.StatusID.ToString() + " " + str.FullText)
    Next
End If

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Truncated Logcat Exception Message

console.log message is truncated

MPI Gatherv not working (message truncated)

tweepy: truncated tweets when using tweet_mode='extended'

MongoDB Sink Connector : Message truncated in Apache Kafka

Does Logstash truncate plugin add tags only if message was really truncated?

Truncated Message due to "TypeError: unhashable type: 'bytearray'" (in raspberry pi)

Truncate output after X lines and print message if and only if output was truncated

Can a logback message field be truncated/trimmed to n characters?

'PDOException' with message 'SQLSTATE[22001]: String data, right truncated: 0

error_log message is truncated when using print_r

mpi4py - MPI_ERR_TRUNCATE: message truncated

Internet Explorer pop up message truncated in Windows 10

Why would a correct shell script give a wrapped/truncated/corrupted error message?

An error occurred in MPI_Scatterv (message truncated) while trying to distribute an array

Excel, cut-n-paste ERROR-MESSAGE: "The picture is too large and will be truncated."

Drupal: Exception 'PDOException' with message 'SQLSTATE[01000]: Warning: 1265 Data truncated for column 'created'

Tweets in Python

Truncated to the minute

Matching URLs found in Tweets

Count symbols/punctuation in tweets

Is it possible to display tweets in monogame?

TweetInvi Tweets to string or Json

Reply to tweets in tweepy

Tweets from past periods

Can not render tweets

Apache Spark - Tweets Processing

Putting several tweets in dataframe

Exporting tweets to a dataframe