Skip to content
New issue

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

Add Threads API #57

Open
deadcoder0904 opened this issue Jul 18, 2021 · 6 comments
Open

Add Threads API #57

deadcoder0904 opened this issue Jul 18, 2021 · 6 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request feature request A request for adding support for a new feature in the library request twitter The feature request can only be fulfilled once twitter adds suport for it in the api

Comments

@deadcoder0904
Copy link

I would love to use this module as its well-maintained & uses TS.

However, I need support for threads. You can use https://github.com/adblanc/twit-thread/ for inspiration.

Curious to see docs, supported features, comparison with other Twitter modules? Basically roadmap :)

@iShibi
Copy link
Member

iShibi commented Jul 18, 2021

Hey, thanks for checking out the library. Supporting threads sounds cool but unfortunately there is no endpoint for this in Twitter API v2. The library you have linked is a wrapper for another twitter api library and the former adds support for threads by looping over the sent tweets. This isn't something that a core client library like twitter.js can add natively as it's too specific and should be either done by the user itself or by a framework of the library. You can ask for this feature for the API here. Once an endpoint for threads is public we will definitely add support for it in twitter.js.

We do have docs that get generated using the comments in the source code, you can see it here. It's a bit outdated, I'll make the docs build & publish on each merge soon, which will keep it up to date with the source code. The other thing related to docs that we have planned is a custom site for it. The current docs site gets auto generated by typedoc. We also have a guide website planned that will help new users learn how to use the library. This will be the best place to teach niche topics like "how to create a thread using twitter.js?" and more. The guide will come sooner than the custom docs website.

As you can see most of the roadmap isn't written anywhere as I'm working alone at this point of time and the current highest priority is to add support for all the endpoints that are currently public in Twitter API v2. With v0.3.0 we would reach that point as I've added support for most of the endpoints that were left. This means twitter.js v0.3.0 will be here in a week or two. After that I'll shift the focus towards docs, guide, a proper README and hopefully an actual roadmap ;)

I'll keep the issue open until we have all of the above stuff done. 👍

@iShibi iShibi pinned this issue Jul 18, 2021
@iShibi iShibi added documentation Improvements or additions to documentation enhancement New feature or request feature request A request for adding support for a new feature in the library request twitter The feature request can only be fulfilled once twitter adds suport for it in the api labels Jul 18, 2021
@deadcoder0904
Copy link
Author

@iShibi so the threads API isn't available in v2? Or it was never available in v1 as well but users were looping through tweets as a workaround?

@iShibi
Copy link
Member

iShibi commented Jul 18, 2021

There doesn't seem to be anything related to threads in v1. The Twitter API v2 is still in dev and the endpoints for creating tweets haven't been released yet. So they may or may not add threads this time. However, I did find an old post asking for this feature here. It says it's under review.

@deadcoder0904
Copy link
Author

@iShibi can you tell me then if it's possible to support threads using your library as twit-thread uses twit underhood so I don't want to install 2 libraries doing the same thing :)

@iShibi
Copy link
Member

iShibi commented Jul 18, 2021

Currently twitter.js can't even post normal tweets as the endpoints for it aren't published yet. Once they are here then yes you can easily create threads using tweet create and replies (which is what that lib is doing). We will have a section in the guide teaching how to do it.

If twitter decides to provide endpoints for creating threads then the lib will support that natively and you won't have to do the above stuff.

tl;dr if you want a solution right now then you can use them but, if you can wait then yeah you won't have to install two libs in any case, as twitter.js will let you create threads. The "How" depends on whether twitter provides an endpoint for threads or not.

@deadcoder0904
Copy link
Author

Perfect! Lmk when you ship the tweets endpoint :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request feature request A request for adding support for a new feature in the library request twitter The feature request can only be fulfilled once twitter adds suport for it in the api
Projects
None yet
Development

No branches or pull requests

2 participants