twython
twython copied to clipboard
Handle upcoming changes to Tweets
There are some changes happening to Tweets at some point, as outlined in this post.
I can see a couple of things that need doing:
- Add the new error code 386 ("The Tweet exceeds the number of allowed attachment types") to
TWITTER_HTTP_STATUS_CODEin twython/endpoints.py - Make
Twython.html_for_tweet()handle tweets that have notextfield but do have afull_textfield. Maybe just a quick check as to which field is present, and use that? I'm not sure if the method should do anything more clever.
I've read that post a couple of times now, and I don't think there's anything more Twython needs to do to cope, but I may well be wrong. A second opinion would be good! (fwiw, requesting tweets from the API with the new tweet_mode='extended' works, returning the new format of JSON.)
FYI, submitted PR #429 to add proper support in Twython.html_for_tweet() for extended tweets. Comments are welcomed!