Chicago Python Workshop/Projects/Twitter: Difference between revisions

Content added Content deleted
imported>Codersquid
(→‎1. Read through and understand search: made it more clear that the python call is run from the command line and not the python prompt. also tried to make it clear that you use the text editor to read through the flle)
imported>Codersquid
(added list point to ask people to open the python files for this project)
Line 17: Line 17:
=== 1. Read through and understand <code>search</code> ===
=== 1. Read through and understand <code>search</code> ===


# Use your text editor to open the python files that we extracted from Twitter.zip during the Friday night [[Chicago Python Workshop/Setup|Setup]].
* twitter_api.py
* twitter_functions.py
# Use the command line to run <code>python twitter_api.py --search</code> with various search terms, e.g.
# Use the command line to run <code>python twitter_api.py --search</code> with various search terms, e.g.
#* <code>python twitter_api.py --search=Python</code>
#* <code>python twitter_api.py --search=Python</code>
Line 28: Line 31:
=== 2. Read through and understand <code>trendingTopics</code> ===
=== 2. Read through and understand <code>trendingTopics</code> ===


# Run <code>python twitter_api.py --trending-topics</code>
# Use the command line to run <code>python twitter_api.py --trending-topics</code>
# Read through the <code>trendingTopics</code> function in <code>twitter_functions.py</code>.
# Use the text editor to read through the <code>trendingTopics</code> function in <code>twitter_functions.py</code>.
# Trace through the logic in <code>twitter_api.py</code> that turns the <code>--trending-topics</code> command line option into a call to <code>search</code>.
# Trace through the logic in <code>twitter_api.py</code> that turns the <code>--trending-topics</code> command line option into a call to <code>search</code>.
# Find <code>GetTrendsWoeid</code> in the Twitter library code at http://code.google.com/p/python-twitter/source/browse/twitter.py. How many trending topics does that method return?
# Find <code>GetTrendsWoeid</code> in the Twitter library code at http://code.google.com/p/python-twitter/source/browse/twitter.py. How many trending topics does that method return?