Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No differences between Text and FullText #213

Open
apaillarse opened this issue Oct 18, 2017 · 7 comments
Open

No differences between Text and FullText #213

apaillarse opened this issue Oct 18, 2017 · 7 comments
Labels

Comments

@apaillarse
Copy link

apaillarse commented Oct 18, 2017

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.

@muesli
Copy link
Collaborator

muesli commented Nov 18, 2017

@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)
...

@muesli muesli added the bug label Nov 18, 2017
@krisiasty
Copy link

Yep, I hit the same issue, but with tweet_mode set to extended it looks good now. Thanks.

@apaillarse
Copy link
Author

It didn't change anything for me...
Can you share your code @krisiasty ?

@jnflint
Copy link

jnflint commented Mar 31, 2018

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

@muesli
Copy link
Collaborator

muesli commented Mar 31, 2018

@jnflint I believe that is how the Twitter API behaves and how it is documented.

@jnflint
Copy link

jnflint commented Mar 31, 2018

@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

@wotzhs
Copy link

wotzhs commented Apr 4, 2018

perhaps it would be helpful to have this in the readme :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants