twitter-lite
twitter-lite copied to clipboard
Equivalent to Twit.postMediaChunked?
As we all know Twit is getting more and more broken by the day (especially postMediaChunked), so an alternative is more than welcome. Has support for chunked media uploaded been added? Right now no good library exists to easily upload a file to Twitter via this API, so having this functionality would be amazing.
Hi @Fdebijl! Thanks for bringing up this issue. We don't currently support a postMediaChunked
method in the same way that Twit does, however we do support POST endpoints.
We'll flag this as a new feature and we can try and get to it in the near future. In the meantime, though, PRs are welcome!! If you or someone else wants to contribute this, we can totally work with you to get support for chunked media uploads added.
Relevant issue in twit that could be of use: https://github.com/ttezel/twit/issues/496.
I am currently writing myself a little tweet app and also will need media upload. I might provide the relevant code. Not sure if it should be part of this lightweight lib though. Could be sort of a plugin/extension like:
import { fileUpload, urlUpload } from "twitter-lite-media"
const client = new Twitter(...)
// Upload a file
const uploadedMedia = await fileUpload(client, file, "image/gif")
// Upload from an URL
const uploadedUrlMedia = await urlUpload(client, "https://s3.amazon.com/9823423deadbead...")
What you think?
Hey @pke,
Adding uploading media would be a great idea! We can keep the entry / exits separate when bundling :smile:
Do you mind opening up a PR and we'll glady review