api.search() results don't match query #1442
-
I am using tweepy to find tweets matching a query. After setting up an api instance, I do the following:
Any idea what is happening? Why don't all the results match the query? Thank you for the reply! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Text can sometimes be "extended text" so if the string "Tweepy" exists in the tweet at all, it shows up in the returned variable. Some texts that are over (I think) 100 characters need to be called as "extended_text". If you |
Beta Was this translation helpful? Give feedback.
-
There are multiple possible reasons for that statement to be printing False. The most common is likely due to the standard search API not being case-sensitive. Therefore, any Tweet result with "Tweepy" in it (or with any other variation in case) will print False with that statement. Another possible reason is that without using extended mode, only the first 140 characters of the Tweet's text will be returned, and the rest will be truncated. The standard search API will still return results matching the query in the parts of the Tweet's text that are truncated. This means your statement will print False in the cases that the query is only in the Tweet's text past 140 characters. Additionally, the query itself might not even be in the Tweet's text. The standard search API will also return results with the query in the user's name, the user's screen name, a URL entity part of the Tweet, etc. This applies to Retweets as well. |
Beta Was this translation helpful? Give feedback.
There are multiple possible reasons for that statement to be printing False.
The most common is likely due to the standard search API not being case-sensitive. Therefore, any Tweet result with "Tweepy" in it (or with any other variation in case) will print False with that statement.
Another possible reason is that without using extended mode, only the first 140 characters of the Tweet's text will be returned, and the rest will be truncated. The standard search API will still return results matching the query in the parts of the Tweet's text that are truncated. This means your statement will print False in the cases that the query is only in the Tweet's text past 140 characters.
This will …