Is anyone using the twitter module for python (https://github.com/sixohsix/twitter/tree/master) able to publish pictures on twitter account? Everything works fine with publishing text to status, but I couldn't figure how to publish pictures. Thanks for the help.
Adding my code, as suggested in the comments (thanks for that!):
import twitter
t = twitter.Twitter(auth=twitter.OAuth('PAR1', 'PAR2','PAR3', 'PAR4')) #autentication is fine.
#t.statuses.update(status="Hello World!") #this command works fine!
t.updateStatusWithMedia('http://url_of_image', status="Hello World!") #that's what I need to do.
If you are using the external
twitter
module, I assume that installing other external libraries is acceptable to you. You could trytweetphoto
to upload images via an API. You can figure it out here.I guess the twitter module doesn't deal with the method POST, or I couldn't make it work. I could do it with Twython: