About twitterstream.py: 

Used to fetch live stream data from twitter.

Requires oauth2, which is not part of the EnThought Python library.

usage:
Open the program and replace access_token_key, access_token_secret, consumer_key, and consumer_secret with the appropriate values. Then run
$ python twitterstream.py


To get credentials:

<ol>
<li>Create a twitter account if you do not already have one.</li>

<li>Go to <a href="https://dev.twitter.com/apps"><strong>https://dev.twitter.com/apps</strong></a> and log in with your twitter credentials.</li>

<li>Click &quot;Create New App&quot;</li>

<li>Fill out the form and agree to the terms. Put in a dummy website if you don't have one you want to use.</li>

<li>On the next page, click the &quot;API Keys&quot; tab along the top, then scroll all the way down until you see the section &quot;Your Access Token&quot;</li>

<li>Click the button &quot;Create My Access Token&quot;. You can <a href="https://dev.twitter.com/docs/auth"><strong>Read more about Oauth authorization.</strong></a></li>

<li>You will now copy four values into twitterstream.py.  These values are your &quot;API Key&quot;, your &quot;API secret&quot;, your &quot;Access token&quot; and your &quot;Access token secret&quot;.  All four should now be visible on the API Keys page. (You may see &quot;API Key&quot; referred to as &quot;Consumer key&quot; in some places in the code or on the web; they are synonyms.) Open twitterstream.py and set the variables corresponding to the api key, api secret, access token, and access secret.  You will see code like the below: 

<pre>
api_key = "&lt;Enter api key&gt;"
api_secret = "&lt;Enter api secret&gt;"
access_token_key = "&lt;Enter your access token key here&gt;"
access_token_secret = "&lt;Enter your access token secret here&gt;"
</pre>
</li>

<li>Run the following and make sure you see data flowing and that no errors occur. 

<pre>$ python twitterstream.py > output.txt</pre>

This command pipes the output to a file.  Stop the program with Ctrl-C, but wait at least <strong>3 minutes</strong> for data to accumulate. Keep the file output.txt for the duration of the assignment; we will be reusing it in later problems.  Don’t use someone else’s file; we will check for uniqueness in other parts of the assignment.
</li>
</ol>