twitter-lite icon indicating copy to clipboard operation
twitter-lite copied to clipboard

Equivalent to Twit.postMediaChunked?

Open fdebijl opened this issue 4 years ago • 4 comments

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.

fdebijl avatar Feb 06 '20 13:02 fdebijl

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.

dylanirlbeck avatar Feb 20 '20 17:02 dylanirlbeck

Relevant issue in twit that could be of use: https://github.com/ttezel/twit/issues/496.

dylanirlbeck avatar Feb 20 '20 17:02 dylanirlbeck

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?

pke avatar Apr 17 '20 16:04 pke

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

peterpme avatar Apr 22 '20 16:04 peterpme