jpopesculian / twitter-v2-rs

Rust bindings for Twitter API v2
https://docs.rs/twitter-v2/latest
102 stars 28 forks source link

How do I tweet with an image? #25

Open eightfx opened 1 year ago

eightfx commented 1 year ago

To tweet with an image, we need to follow these steps I think.

  1. upload the image as media
  2. get the uploaded media id
  3. call the TwitterApi::~~~~.post_tweet().add_media(my_media_id).send()

I do not know how to do step 1 - 2.

Thanks for your help.

jyap808 commented 6 months ago

You need to upload the image with API v1.

Wrote a blog post here (although sample code is in Golang): https://julianyap.com/posts/2024-03-13-1710365831/