Chicago Python Workshop/Projects/Twitter: Difference between revisions

→‎1. Read through and understand search: changed the sentence about passing options since that was inconsistent with how we had explained past before in class.
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
(→‎1. Read through and understand search: changed the sentence about passing options since that was inconsistent with how we had explained past before in class.)
 
(4 intermediate revisions by the same user not shown)
Line 17:
=== 1. Read through and understand <code>search</code> ===
 
# Open a terminal and navigate to the directory where you extracted Twitter.zip. If you need a reminder for how to open a terminal and navigate to a directory, follow the [[https://openhatch.org/wiki/Chicago_Python_Workshop/Setup#Goal_.234:_practice_navigating_the_computer_from_a_command_prompt|navigation setup goal]] from Friday.
# The directory you navigate to should contain ''twitter_api.py'' and ''twitter_functions.py''.
# Use your text editor to open ''twitter_api.py'' and ''twitter_functions.py''.
# 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>
Line 22 ⟶ 25:
# Use the text editor to read through the <code>search</code> function in <code>twitter_functions.py</code>.
# Trace through the logic in <code>twitter_api.py</code> that turns the <code>--search</code> command line option into a call to <code>search</code>.
# Find <code>GetSearch</code> in the Twitter library code at http://code.google.com/p/python-twitter/source/browse/twitter.py. What other options could we have passedused towith <code>GetSearch</code>?
 
<b>Check your understanding</b>: What does <code>api.GetSearch</code> return?
Line 28 ⟶ 31:
=== 2. Read through and understand <code>trendingTopics</code> ===
 
# RunUse the command line to run <code>python twitter_api.py --trending-topics</code>
# ReadUse 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>.
# 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?
Anonymous user