twitter-openapi-typescript
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "twitter-openapi-typescript", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Implementation of Twitter internal API in TypeScript", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,11 +0,17 @@ | ||
# twitter-openapi-typescript@0.0.2 | ||
# twitter-openapi-typescript@0.0.5 | ||
```sh | ||
npm i twitter-openapi-typescript | ||
``` | ||
```typescript | ||
import { TwitterOpenApi } from "twitter-openapi-typescript"; | ||
import fetch from "node-fetch"; | ||
const api = new TwitterOpenApi(); | ||
const client = await api.getClientFromCookies('<csrf toke here>', '<auth token here>'); | ||
api.setFetchApi(fetch as any); | ||
const client = await api.getClientFromCookies('<csrf toke here>', '<auth token here>'); // option | ||
const response = await client.getUserApi().getUserByScreenName({ screenName: 'elonmusk' }); | ||
const legacy = response.data.legacy; | ||
console.log(response.data); | ||
console.log(legacy.screenName); | ||
console.log(`followedBy: ${legacy.followedBy} following: ${legacy.following}`); | ||
console.log(response.data.legacy.screenName); | ||
console.log(`followCount: ${response.data.legacy.friendsCount} followersCount: ${response.data.legacy.followersCount}`); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213586
18