Skip to content
New issue

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

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

Already on GitHub? # to your account

Incompatibility with standard REST APIs in extended mode #43

Open
jmargutt opened this issue May 23, 2019 · 2 comments
Open

Incompatibility with standard REST APIs in extended mode #43

jmargutt opened this issue May 23, 2019 · 2 comments

Comments

@jmargutt
Copy link

jmargutt commented May 23, 2019

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.

@fionapigott
Copy link
Contributor

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?

@jmargutt
Copy link
Author

jmargutt commented Jun 19, 2019

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

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

No branches or pull requests

2 participants