ChimeraCoder / anaconda

A Go client library for the Twitter 1.1 API
MIT License
1.14k stars 247 forks source link

Support the new `extended tweet_mode` API #200

Closed muesli closed 7 years ago

muesli commented 7 years ago

Twitter's API has changed and now shortens statuses that are longer than 140 chars, but have an acceptable length by the new Twitter rules.

This change introduces Tweet.FullText, which contains the unshortened form of the status. Tweet.Text's behavior should be unchanged and will contain the shortened form. All API requests are now executed in the new extended mode.

Sadly the streaming API now behaves slightly different to the regular REST API and contains the extended Tweet information in a separate struct. This change also parses this extra struct and correctly merges the status into the Tweet struct, so both API modes behave the same and remain backwards compatible, as far as anaconda users are concerned.

This PR makes #158 and #190 obsolete.

muesli commented 7 years ago

Will fix the detected issues in tests.

muesli commented 7 years ago

There we go, I've fixed one bug and updated the test cases to match the new API responses / requests.

muesli commented 7 years ago

This can probably still be improved by attaching our own UnmarshalJSON method to anaconda.Tweet. Will look at that now.

muesli commented 7 years ago

Got a fix for retweets coming up and will squash everything then.

muesli commented 7 years ago

Alright, I think we're all set!

muesli commented 7 years ago

Looks like Travis-CI is stuck...

muesli commented 7 years ago

Rebased to upstream/master!