Answer the question
In order to leave comments, you need to log in
How to make python treat a phrase as one word?
The fact is that the phrases that are in the list are divided into words and the search for tweets is incorrect.
Let's say if I need to find tweets with the phrase "Hello World" (Exactly Hello World), he first searches for tweets with the word hello and then world.
import config
keyphrases [''hello word,'Donald Trump'] ## список
for key_phrase in config.keyphrases: ## перелопачиваем список
for tweet in Cursor (api.search, q=key_phrase).items(190): ## находим 190 твитов
api.retweet(tweet.id) ## ретвитим каждый из них
Answer the question
In order to leave comments, you need to log in
And here Python? This is a question for the Twitter API.
q required A UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity.
despite the fact that you need to present the request in this form "\"hello world\""
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question