Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

can't get short_url_length within api.configuration() #2026

Closed
reagle opened this issue Dec 9, 2022 · 1 comment
Closed

can't get short_url_length within api.configuration() #2026

reagle opened this issue Dec 9, 2022 · 1 comment
Labels
API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion Duplicate This is a duplicate Question This is a question Stale This is inactive, outdated, too old, or no longer applicable

Comments

@reagle
Copy link

reagle commented Dec 9, 2022

Until today I've been able to truncate my long tweets into 280 characters by assuming URLs are shortened to length of 23. Today, that's not working, and I thought perhaps the short url length had changed. It's also, more likely, because I'm using an emoji (see #1538), but I wanted to check and I see recommendations to check the Twitter API configuration, but that doesn't work.

What there a way to get API configuration values? Where did it go?

@Harmon758
Copy link
Member

API.configuration was removed in Tweepy v4.0.0, as the Twitter API endpoint that it used was retired (see #1614).

Instead, if you're using Twitter API v1.1, you can use the indices field of the corresponding URL object to determine the length of the URL in the text of the Tweet. If you have the Tweet object, you can retrieve its URL objects through the entities field and the urls field of that Entities object.

@Harmon758 Harmon758 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2022
@Harmon758 Harmon758 added Question This is a question Duplicate This is a duplicate API This is regarding Twitter's API Stale This is inactive, outdated, too old, or no longer applicable labels Dec 11, 2022
@tweepy tweepy locked and limited conversation to collaborators Dec 11, 2022
@Harmon758 Harmon758 converted this issue into discussion #2028 Dec 11, 2022
@Harmon758 Harmon758 added the Discussion This was converted/moved from/to a discussion label Dec 11, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion Duplicate This is a duplicate Question This is a question Stale This is inactive, outdated, too old, or no longer applicable
Projects
None yet
Development

No branches or pull requests

2 participants