FeedHive/twitter-api-client

Include an example on how to upload an image with a tweet

lilsweetkara opened this issue · 3 comments

Sorry about the noise and thank you for the library.
I need to publish tweets with images in them. The image is actually public and online -- however, my understanding is that the Twitter API requires you to upload the image with the API.
I am banging my head against the wall trying to make this happen.

Are you able to give me some guidance on how publish a tweet with a photo?

I believe this requires uploading of media first, and then posting of the twitter using the media ID.

When I post, if the image is on an URL, am I able to pass it a stream, so that I don't have to download it from the internet first? Are you able to give me some guidance/working code to do that?

Oh yes, the feature request: please add this as an example in your README!

Hi, @lilsweetkara.
Thank you for creating this issue.

Twitter has covered this in their own documentation for the media upload endpoint.

But I agree, it can be a bit tedious the first time you have to set it up.

We are going to include a method in the library that'll handle uploading, chucking and posting media, so that you can call a single method in the Twitter API Client to take care of all that.

In terms of documentation, we can't really provide better ones than Twitter has already provided - so maybe you need to create a request at the Twitter Developer team instead.

I'll close this issue for now 😊

@SimonHoiberg any update on the aforementioned method?