I've installed the python twitter library of sixohsix (https://github.com/sixohsix/twitter) and tried to connect to Twitter, but it doesn't work. This is my code:
#!/usr/bin/env python
from twitter import *
OAUTH_TOKEN = '...'
OAUTH_SECRET = '...'
CONSUMER_KEY = '...'
CONSUMER_SECRET = '...'
t = twitter.Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET, CONSUMER_KEY, CONSUMER_SECRET))
# Get your "home" timeline
t.statuses.home_timeline()
The error message I get is:
Traceback (most recent call last):
File "./twitter.py", line 3, in <module>
from twitter import *
File "/home/XXX/twitter.py", line 11, in <module>
t = Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET, CONSUMER_KEY, CONSUMER_SECRET))
NameError: name 'Twitter' is not defined
I don't know why this error occurs. I also tried
t = twitter.Twitter(...)
but it doesn't work either. I found some posts at stackOverflow, butt all solutions doesn't work.