Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
82df16e4
Commit
82df16e4
authored
Aug 13, 2009
by
Josh Roesslein
Browse files
Added testing shell.
parent
d8f598cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepyshell
0 → 100755
View file @
82df16e4
#!/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 <username> <password>'
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
(
'<Tweepy shell>'
,
local
=
{
'tweepy'
:
tweepy
,
'api'
:
api
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment