Acceder a datos de retuits
Ahora vamos a trabajar con un JSON de un tuit que contiene un retuit. Un retuit tiene la misma estructura que un tuit normal, excepto que incluye otro tuit almacenado en retweeted_status.
El nuevo tuit se ha cargado como rt.
Este ejercicio forma parte del curso
Análisis de datos de redes sociales con Python
Instrucciones del ejercicio
- Imprime el texto del tuit.
- Imprime el texto del tuit que ha sido retuiteado, que está en
retweeted_status. - Imprime el usuario (handle) del tuit.
- Imprime el usuario (handle) del tuit que ha sido retuiteado, que está en
retweeted_status.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Print the text of the tweet
print(rt[____])
# Print the text of tweet which has been retweeted
print(rt[____][____])
# Print the user handle of the tweet
print(rt[____][____])
# Print the user handle of the tweet which has been retweeted
print(rt[____][____][____])