-
Notifications
You must be signed in to change notification settings - Fork 13
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
Search by username throw error #113
Comments
The following test works fine. twitter-openapi-typescript/twitter-openapi-typescript/test/api/userApi.test.ts Lines 4 to 10 in fb62699
Can you provide source code to reproduce? |
Hmm, for some reason today all working good with same code export class FetchServices {
private readonly scraper = new Scraper();
private readonly api = new TwitterOpenApi();
async getTwitterProfile(username: string): Promise<{
username: string;
name?: string;
followersCount: number;
tweetsCount: number;
images: {
avatar: string;
banner?: string;
};
} | null> {
const twitterClient = await this.api.getGuestClient();
const r = await twitterClient
.getUserApi()
.getUserByScreenName({ screenName: username });
if (r && r.data && r.data.user) {
return {
username: r.data.user.legacy.screenName,
name: r.data.user.legacy.name || undefined,
followersCount: r.data.user.legacy.normalFollowersCount || 0,
tweetsCount: r.data.user.legacy.statusesCount || 0,
images: {
avatar: r.data.user.legacy.profileImageUrlHttps.replace(
'_normal',
''
),
banner: r.data.user.legacy.profileBannerUrl,
},
};
}
return null;
}
} |
Twitter's anti-spam system gets frequent updates, so maybe that's why. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Searching by any username returns error (Response returned an error code)
The text was updated successfully, but these errors were encountered: