anaconda
anaconda copied to clipboard
No differences between Text and FullText
Hello, First of all thanks for this good library ! I'm having a problem retrieving the full length of tweets when they are truncated. I'm using the following simple code :
api := anaconda.NewTwitterApi(accessToken, accessTokenSecret)
stream := api.PublicStreamFilter(url.Values{
"track": trackingArray,
})
defer stream.Stop()
for v := range stream.C {
t, ok := v.(anaconda.Tweet)
if !ok {
logrus.Warningf("received unexpected value of type %T", v)
continue
}
fmt.Print(t.Text)
fmt.Print(t.FullText)
}
Both printing methods print exactly the same tweet (the full tweet if its length is low and a truncated tweet if its length is over 140 characters). It may be a dumb question as I'm not an expert in programming. Anyway thanks for the time you spend responding to me.
@apaillarse: Thanks for your report! Can you check if the problem still exists if you initialize the stream like this:
...
v := url.Values{}
v.Set("tweet_mode", "extended")
v.Set("track", trackingArray)
stream := api.PublicStreamFilter(v)
...
Yep, I hit the same issue, but with tweet_mode set to extended it looks good now. Thanks.
It didn't change anything for me... Can you share your code @krisiasty ?
I thought I had this issue but what I found was if it was a retweet, the FullText is always truncated (it's as received). If you check
if tweet.RetweetedStatus != nil { originalFull_text = tweet.RetweetedStatus.FullText }
you will get the >140 chars version
@jnflint I believe that is how the Twitter API behaves and how it is documented.
@muesli yes, I was just mentioning as the stream I am looking at has a very high level of retweets so it looked like there was a problem when there wasn't. Thought I would mention it in case someone else thought the shorten text in retweets was a problem
perhaps it would be helpful to have this in the readme :)