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

Use Twitter API v2 #195

Closed
IstoraMandiri opened this issue Sep 6, 2022 · 5 comments
Closed

Use Twitter API v2 #195

IstoraMandiri opened this issue Sep 6, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@IstoraMandiri
Copy link
Contributor

What happened?

Perhaps because of twitter deprecating it's v1 API for new twitter account applications, after creating a new tweet, the following error occurs.

Run gr2m/[email protected]
Running twitter-together version 0.0.0-development
Tweeting: Hello, world!
error
[
  {
    message: 'You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve',
    code: 453
  }
]

What did you expect to happen?

For simple tweets, it should not need Elevated access.

What the problem might be

Support for twitter-api-v2 node library or some fork of twitter that supports v2, rather than twitter (updated 5 years ago) which supports v1 only.

@IstoraMandiri IstoraMandiri added the bug Something isn't working label Sep 6, 2022
@IstoraMandiri IstoraMandiri changed the title Supper Twitter API v2 Use Twitter API v2 Sep 6, 2022
@gr2m
Copy link
Contributor

gr2m commented Sep 6, 2022

I'd very much appreciate any help with upgrading, as much as I wish I could, I can't devote much time to twitter-together right now

@IstoraMandiri
Copy link
Contributor Author

IstoraMandiri commented Sep 7, 2022

Thanks for the response.

I am considering submitting a PR with a drop-in replacement of the current twitter package with twitter-lite which supports the same JS methods as well as the v2 API. This should require minimal code changes and maintain compatibility with the draft Front Matter PR.

Sound like a good approach?

EDIT: After looking deeper, it seems not to be a simple drop in replacement and will require updating request endpoints and params. For now I won't be pursuing this as we found an account with v1 access.

@MattIPv4
Copy link
Member

Adding a note here that moving to the v2 API will allow for using the polls object on the status update API, removing the need for calling the Ads API in the code (completely removing the need for the createPoll method).

@MattIPv4
Copy link
Member

Also adding a note that moving to a newer library should unlock the ability for alt text to be added to media (see #177 -- the current twitter library does not support the correct payload format).

@MattIPv4 MattIPv4 self-assigned this Sep 23, 2022
@MattIPv4
Copy link
Member

MattIPv4 commented Oct 6, 2022

#207

@MattIPv4 MattIPv4 closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@gr2m @IstoraMandiri @MattIPv4 and others