twitter-api-client-ts
v1.0.3
Published
A Twitter api client using email and password.
Downloads
7
Readme
twitter-api-client-ts
A Twitter api client using email and password.
This project is based on twitter-api-client and is bound to TypeScript.
Features
| Features | twitter-api-client-ts | | -------- | ------------------------------------------------------------ | | Account | Only tweeting normal text. | | Scraper | ❌ | | Search | ❌ | | GraphQL | ⭕ All available.(but the api interface was not implemented) |
Usage
import { Account } from "twitter-api-client-ts"
async main(){
const account=new Account("email","username","password")
await account.login()
account.tweet("Hello World!")
}
Get a user status by GraphQL
import { Account } from "twitter-api-client-ts";
const account = new Account("email", "username", "password");
await client.login();
const user = await client.gql("GET", "UserTweets", {
userId: "44196397",
});
const entries = user.data.user.result.timeline_v2.timeline.instructions.filter(
(x: any) => x.type === "TimelineAddEntries"
)[0].entries;
const result = entries
.map((e: any) => {
return e.content?.itemContent?.tweet_results?.result?.legacy;
})
.filter((x: any) => x !== undefined)
.filter((x: any) => x.user_id_str === "44196397");
console.log(result);