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
(Created page with "right|300px == Project == Use the Twitter API to write the basic parts of a Twitter client. See what your friends are tweeting, get trending topics, se...")
 
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.)
 
(5 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.
# Run <code>python twitter_api.py --search</code> with various search terms, e.g.
# 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''.
# RunUse 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="Red Sox"</code>
# ReadUse 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?
 
 
=== 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