tweet_parser
tweet_parser copied to clipboard
Incompatibility with standard REST APIs in extended mode
When using standard REST APIs in extended mode (passing tweet_mode=extended to any endpoint) the tweet contains no "text" field, only a "full_text" one. Therefore tweet_checking.check_tweet() throws a NotATweetError.
Hi, Thanks for the note, that's a good point. I imagine fixing this bug would involve changing the tweet_text.py getters and checking others for compatibility with the "extended" mode. Are there any other areas where extended mode isn't functioning as expected with the tweet_parser package? Can you share any workarounds you've used?
I did not encounter other areas where extended mode isn't functioning.
Easy and ugly workaround: add to tweet_text.get_text() and .get_full_text()
if ("text" not in tweet and "full_text" in tweet): return tweet["full_text"] elif ...
and remove "text" from tweet_checking._check_original_format_tweet(), so that it looks like
for key in ["user"]: if key not in tweet: raise NotATweetError("This dict has no '{}' key".format(key))