Hi all,
I am new to twitter and python, so probably your worst nightmare :-)
I have followed the tutorial here
http://jmillerinc.com/2010/05/31/twitter-from-the-command-line-in-python-using-oauth/
very clear and precise and got it all working
Then I thought lets try for a direct message as follows
#!/usr/bin/env python
import sys
import tweepy
CONSUMER_KEY = 'my key from twitter'
CONSUMER_SECRET = ' this is the secret'
ACCESS_KEY = 'access key'
ACCESS_SECRET = 'access secret'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
myuser = '201272679'
#api.update_status(sys.argv[1])
api.send_direct_message(myuser, sys.argv[1])
as you can see from the example I have just commented out the
api.update_status and added a call for direct message.
the myuser is the id from the rss at the bottom of my page and I have
also used my page id but get the following error
Traceback (most recent call last):
File "./tweet_me.py", line 15, in <module>
api.send_direct_message(myuser, sys.argv[1])
File "/usr/local/lib/python2.6/dist-packages/tweepy-1.7.1-py2.6.egg/
tweepy/binder.py",
line 179, in _call
return method.execute()
File "/usr/local/lib/python2.6/dist-packages/tweepy-1.7.1-py2.6.egg/
tweepy/binder.py",
line 162, in execute
raise TweepError(error_msg, resp)
tweepy.error.TweepError: Invalid request.
Ubuntu 10.04,
if anyone has time to point out where I am going wrong I would
appreciate it
all the best
Ian