Here is the code I am using, mainly to test to see if everything is authorizing correctly, and to try to post for the first time.
import tweepy
CONSUMER_KEY ="XXXXXXXXXXXXXXXXXXXXXXXXX"
CONSUMER_SECRET = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
ACCESS_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
ACCESS_SECRET = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
api.update_status('Updating using OAuth authentication via Tweepy!')
and here is the error I am getting when I run it from the command line:
C:\Users\CJ\Desktop>python tweeper.py
Traceback (most recent call last):
File "tweeper.py", line 13, in <module>
api.update_status('Updating using OAuth authentication via Tweepy!')
File "C:\python33\lib\site-packages\tweepy-1.4-py3.3.egg\tweepy\binder.py", li
ne 153, in _call
tweepy.error.TweepError: Twitter error response: status code = 401
I've searched stack overflow, dev.twitter and google for everything I could regarding the 401 error from Twitter and line 153 from tweepy\binder.py, but I couldn't find much of anything specific to my problem.
One thing I tried was inserting the callback url I used with dev.twitter after CONSUMER_SECRET, such that it read:
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK_URL)
but that gave me the same error. Thanks in advance.