Transmisión de tweets
¡Es hora de transmitir algunos tuits! Tu tarea consiste en crear el objeto Stream
y filtrar los tuits según determinadas palabras clave. Se ha importado tweepy
por ti.
Este ejercicio forma parte del curso
Importación de datos intermedios en Python
Instrucciones del ejercicio
- Crea tu objeto
Stream
con las credenciales proporcionadas. - Filtra tu variable Stream por las palabras clave «
"clinton"
», «"trump"
», «"sanders"
» y «"cruz"
».
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Store credentials in relevant variables
consumer_key = "nZ6EA0FxZ293SxGNg8g8aP0HM"
consumer_secret = "fJGEodwe3KiKUnsYJC3VRndj7jevVvXbK2D5EiJ2nehafRgA6i"
access_token = "1092294848-aHN7DcRP9B4VMTQIhwqOYiB14YkW92fFO8k8EPy"
access_token_secret = "X4dHmhPfaksHcQ7SCbmZa2oYBBVSD2g8uIHXsp5CTaksx"
# Create your Stream object with credentials
stream = tweepy.Stream(____, ____, ____, ____)
# Filter your Stream variable
stream.filter(____)