We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using Twitter twitterauth(...) post_status_update(status="Test tweet")
works fine for me, but how does one include media, e.g. a png file? TwitterAPI seems to implement it as
api = TwitterAPI(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET) file = open('Your_image.png', 'rb') data = file.read() r = api.request('statuses/update_with_media', {'status':'Your tweet'}, {'media[]':data})
with data being of type bytes
data
bytes
In [4]: type(open("folder/file.png","rb").read()) Out[4]: bytes
The text was updated successfully, but these errors were encountered:
No branches or pull requests
works fine for me, but how does one include media, e.g. a png file? TwitterAPI seems to implement it as
with
data
being of typebytes
The text was updated successfully, but these errors were encountered: