Cómo hacer que la búsqueda de Twitter a través de Tweepy sea más rápida

I am using ´tweepy´ library in Python to query tweets from Twitter. I am using a simple query :

query = "google"
f = open('output.txt', 'w')
for tweet in tweepy.Cursor(api.search,
               query,
               count=100,
               result_type="recent",
               include_entities=True,
               lang="en").items():
    f.write(str(tweet.created_at) +'\n')
    f.write(tweet.text.encode('utf-8') + '\n')
    #print tweet.created_at, tweet.text

I notice that, this query takes a lot of time to generate the output, upto 25 minutes. Any idea how this can be made faster ?

Muchas Gracias

preguntado el 28 de mayo de 14 a las 12:05

Honestly, you don't get much simpler than that... It might be an issue with your machine? -

You can try limiting the result of the search, e.g. max 50 tweets lang="en").items(50): -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.