Let's have a look at the following steps:
- Open the command line interface of your choice.
- Got to the required directory where you have downloaded the code file.
cd Downloads/HandsOnBigData/CH08/json
- Let's use the script from here to view the contents of tweets in real time by running the LiveTweets.py script. To execute the LiveTweets.py script, run the following script:
./LiveTweets.py president
The output displays two columns—the first is the timestamp of the tweet, and the second is the text of the tweet:
The code snippet given for LiveTweets.py is given as follows:
#!/usr/bin/pythonimport jsonimport sys ...