From 82df16e41aae530a3ae7ddd5d12b36d013dec265 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Thu, 13 Aug 2009 13:35:25 -0500 Subject: [PATCH] Added testing shell. --- tweepyshell | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tweepyshell diff --git a/tweepyshell b/tweepyshell new file mode 100755 index 0000000..5f7de00 --- /dev/null +++ b/tweepyshell @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import sys + +import code +import tweepy + +"""Launch an interactive shell ready for Tweepy usage + +This script is handy for debugging tweepy during development +or to just play around with the library. +It imports tweepy and creates an authenticated API instance (api) +using the credentials provided. +""" + +if len(sys.argv) != 3: + print 'Usage: tweepyshell ' + exit(1) + +api = tweepy.API(tweepy.BasicAuthHandler(sys.argv[1], sys.argv[2])) +if api.verify_credentials() is False: + print 'Invalid username and/or password!' + exit(1) + +code.interact('', local={'tweepy': tweepy, 'api': api}) + -- 2.25.1