From: Josh Roesslein Date: Fri, 14 Aug 2009 14:55:31 +0000 (-0500) Subject: Update tutorial 1 to show example of API.new() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=14cb43c2064bb1935a6e3151598da089cb592010;p=tweepy.git Update tutorial 1 to show example of API.new() --- diff --git a/tutorial/t1.py b/tutorial/t1.py index 81cf085..a58dfd7 100644 --- a/tutorial/t1.py +++ b/tutorial/t1.py @@ -78,6 +78,15 @@ so we can start playing with the Twitter API. :) api_via_basic = tweepy.API(basic_auth) api_via_oath = tweepy.API(oauth_auth) +""" API.new() shortcut + +To make creating API instances a bit more easy you way use the +static method API.new() to create new instances. Here is an example: +""" +new_basic_api = tweepy.API.new(auth='basic', username, password) +new_oauth_api = tweepy.API.new(auth='oauth', consumer_key, consumer_secret) +new_oauth.api.auth_handler # here's how to access the auth handler to do the oauth flow + """ The End That wraps up this first tutorial. You have learned how to setup