draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 96 forks source link

Support other Twitter APIs #62

Open dylanirlbeck opened 4 years ago

dylanirlbeck commented 4 years ago

This issue is meant to track support for these new Twitter APIs; #50 and #55 are subsumed under this issue. Because we already support GET, POST, and PUT requests to any subdomain of twitter.com (see the Twitter constructor, namely the subdomain property), I'm not even sure that much has to be done for these new APIs besides some testing - with the exception of Filtered Streams, which I believe will require more work.

If anyone chooses to tackle one of these new APIs, please open a separate issue so we can track/discuss your progress there.

On a side note, you can see all the API endpoints at https://developer.twitter.com/en/docs/api-reference-index.

New Twitter APIs

neo commented 4 years ago

one thing I don't know if it's related is that some of these endpoints doesn't have .json at the end of the url, but now it's by default appending .json to everything.

andypiper commented 4 years ago

The .json appends are not present in the new version of the API - that was a partial holdover from back when the API used to support both XML and JSON, so it was time to clean that up as we looked at a full redesign.

kush-mish commented 4 years ago

I tried creating the client with putting version as 'labs/2', and it appended .json, which was not required and gave an error. When can we expect the support for Labs API?

gr2m commented 3 years ago

I tried twitter-lite with the ads api using

const twitter = new Twitter({
  consumer_key,
  consumer_secret,
  access_token_key,
  access_token_secret,
  subdomain: "ads-api",
  version: 9,
});

I was able to get scheduled tweets, but both creating a scheduled tweed and updating an existing one failed with errors that made no sense to me.