I’d like to use Python 2.7 and Tweepy to send a status update to Twitter with a message and some geo-coordinates. I have used Tweepy a lot and everything else works fine, but when I try to pass the coordinates I get an ‘Invalid coordinates.’ message… the co-ordinates themselves are integers from Bing’s API.
See here for tweepy reqs: http://docs.tweepy.org/en/v3.5.0/api.html
Code I am doing:
latitude = 51.5118029
longitude = -0.1337666
tweet = "Some tweet!"
api.update_status(tweet, latitude, longitude)
I get:
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{u'message': u'Invalid coordinates.', u'code': 3}]
Any help much appreciated!
2
Answers
Turns out (unsurprisingly) you need to declare what the lat/lng are, i.e.
Try this:
Without the
lat
andlong
parameter names, tweepy thinks you are supplyingin_reply_to_status_id
. This is the actual method declaration: