D
D
dontgiveafcuk2018-02-16 13:34:24
Python
dontgiveafcuk, 2018-02-16 13:34:24

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

2 answer(s)
D
Dmitry, 2018-02-16
@dmtrrr

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.

D
dontgiveafcuk, 2018-02-16
@dontgiveafcuk

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 question

Ask a Question

731 491 924 answers to any question