Anonymous user
Twitter: Difference between revisions
→Project steps
imported>Jesstess |
imported>Jesstess |
||
Line 47:
<b>Check your understanding</b>: What does <code>api.GetSearch</code> return?
=== 2. Read through and understand <code>trendingTopics</code> ===
Line 59 ⟶ 60:
=== 3. Implement <code>userTweets</code> ===
<ol>
This function should print recent tweets by the username provided on the command line.
You may find the <code>twitter.Api()</code> function <code>GetUserTimeline()</code> helpful.</li>
<li>We've already written some <code>optparse</code> logic for <code>userTweets</code> in <code>twitter_api.py</code>. Read through that logic. In what ways is it the same/different from the logic for <code>search</code>?
<pre>python twitter_api.py -u <username></pre>
Line 71 ⟶ 73:
For example,
<pre>python twitter_api.py -u bostonpython</pre></li>
You should see 20 tweets by the provided username. If you have a Twitter account, try running it on yourself, tweeting something new, and running it again!
</ol>
<b>Check your understanding</b>: What are the two ways to pass command line arguments for <code>userTweets</code>?
|