From 14cb43c2064bb1935a6e3151598da089cb592010 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Fri, 14 Aug 2009 09:55:31 -0500 Subject: [PATCH] Update tutorial 1 to show example of API.new() --- tutorial/t1.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.25.1