Skip to content

Commit

Permalink
Deprecate API methods using now deprecated v1.1 endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Aug 26, 2023
1 parent d2c6647 commit 935ea8c
Showing 1 changed file with 93 additions and 1 deletion.
94 changes: 93 additions & 1 deletion tweepy/api.py
Expand Up @@ -470,6 +470,12 @@ def lookup_statuses(self, id, **kwargs):
Returns full Tweet objects for up to 100 Tweets per request, specified
by the ``id`` parameter.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/lookup endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is
:meth:`Client.get_tweets`.
.. versionchanged:: 4.0
Renamed from ``API.statuses_lookup``
Expand All @@ -496,6 +502,10 @@ def lookup_statuses(self, id, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup
.. _The Twitter API v1.1 statuses/lookup endpoint that this method uses
has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'GET', 'statuses/lookup', endpoint_parameters=(
Expand Down Expand Up @@ -710,6 +720,11 @@ def get_status(self, id, **kwargs):
Returns a single status specified by the ID parameter.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/show endpoint that this method uses
has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is :meth:`Client.get_tweet`.
Parameters
----------
id:
Expand All @@ -735,6 +750,10 @@ def get_status(self, id, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id
.. _The Twitter API v1.1 statuses/show endpoint that this method uses
has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'GET', 'statuses/show', endpoint_parameters=(
Expand Down Expand Up @@ -806,6 +825,12 @@ def destroy_status(self, id, **kwargs):
Destroy the status specified by the ``id`` parameter. The authenticated
user must be the author of the status to destroy.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/destroy endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is
:meth:`Client.delete_tweet`.
Parameters
----------
id
Expand All @@ -820,6 +845,10 @@ def destroy_status(self, id, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id
.. _The Twitter API v1.1 statuses/destroy endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'POST', f'statuses/destroy/{id}', endpoint_parameters=(
Expand All @@ -833,6 +862,11 @@ def retweet(self, id, **kwargs):
Retweets a Tweet. Requires the ID of the Tweet you are retweeting.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/retweet endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is :meth:`Client.retweet`.
Parameters
----------
id
Expand All @@ -847,6 +881,10 @@ def retweet(self, id, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-retweet-id
.. _The Twitter API v1.1 statuses/retweet endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'POST', f'statuses/retweet/{id}', endpoint_parameters=(
Expand All @@ -861,6 +899,12 @@ def unretweet(self, id, **kwargs):
Untweets a retweeted status. Requires the ID of the retweet to
unretweet.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/unretweet endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is
:meth:`Client.unretweet`.
Parameters
----------
id
Expand All @@ -875,6 +919,10 @@ def unretweet(self, id, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-unretweet-id
.. _The Twitter API v1.1 statuses/unretweet endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'POST', f'statuses/unretweet/{id}', endpoint_parameters=(
Expand Down Expand Up @@ -904,6 +952,12 @@ def update_status(self, status, **kwargs):
the user reaches the current allowed limit this method will return an
HTTP 403 error.
.. deprecated:: 4.15.0
`The Twitter API v1.1 statuses/update endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.`_ The Twitter API v2 replacement is
:meth:`Client.create_tweet`.
Parameters
----------
status
Expand Down Expand Up @@ -972,6 +1026,10 @@ def update_status(self, status, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update
.. _The Twitter API v1.1 statuses/update endpoint that this method
uses has been deprecated and has a retirement date of November 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
if 'media_ids' in kwargs:
kwargs['media_ids'] = list_to_csv(kwargs['media_ids'])
Expand All @@ -998,7 +1056,10 @@ def update_status_with_media(self, status, filename, *, file=None,
too long will be silently ignored.
.. deprecated:: 3.7.0
Use :meth:`media_upload` instead.
`The Twitter API v1.1 statuses/update_with_media endpoint that this
method uses has been deprecated and has a retirement date of
November 20, 2023.`_ :meth:`API.media_upload` and
:meth:`Client.create_tweet` can be used instead.
.. versionchanged:: 4.0
Renamed from ``API.update_with_media``
Expand Down Expand Up @@ -1034,6 +1095,11 @@ def update_status_with_media(self, status, filename, *, file=None,
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update_with_media
.. _The Twitter API v1.1 statuses/update_with_media endpoint that this
method uses has been deprecated and has a retirement date of
November 20, 2023.:
https://twittercommunity.com/t/x-api-v2-migration/203391
"""
with contextlib.ExitStack() as stack:
if file is not None:
Expand Down Expand Up @@ -1082,6 +1148,12 @@ def search_tweets(self, q, **kwargs):
authenticating user) are not currently supported on this endpoint.
[#]_\ [#]_
.. deprecated:: 4.15.0
`The Twitter API v1.1 search/tweets endpoint that this method uses
has been deprecated and has a retirement date of September 20,
2023.`_ The Twitter API v2 replacement is
:meth:`Client.search_recent_tweets`.
.. versionchanged:: 4.0
Renamed from ``API.search``
Expand Down Expand Up @@ -1143,6 +1215,9 @@ def search_tweets(self, q, **kwargs):
.. _Twitter's documentation on the standard search API:
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/overview
.. _The Twitter API v1.1 search/tweets endpoint that this method uses
has been deprecated and has a retirement date of September 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'GET', 'search/tweets', endpoint_parameters=(
Expand Down Expand Up @@ -2295,6 +2370,11 @@ def search_users(self, q, **kwargs):
returned by using this API (about being listed in the People Search).
It is only possible to retrieve the first 1000 matches from this API.
.. deprecated:: 4.15.0
`The Twitter API v1.1 users/search endpoint that this method uses
has been deprecated and has a retirement date of September 20,
2023.`_
Parameters
----------
q
Expand All @@ -2313,6 +2393,10 @@ def search_users(self, q, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search
.. _The Twitter API v1.1 users/search endpoint that this method uses
has been deprecated and has a retirement date of September 20,
2023.: https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'GET', 'users/search', endpoint_parameters=(
Expand Down Expand Up @@ -3850,6 +3934,10 @@ def search_geo(self, **kwargs):
of other parameters. For instance, ``lat`` is required if ``long`` is
provided, and vice-versa.
.. deprecated:: 4.15.0
`The Twitter API v1.1 geo/search endpoint that this method uses has
been deprecated and has a retirement date of September 20, 2023.`_
.. versionchanged:: 4.0
Renamed from ``API.geo_search``
Expand Down Expand Up @@ -3894,6 +3982,10 @@ def search_geo(self, **kwargs):
References
----------
https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search
.. _The Twitter API v1.1 geo/search endpoint that this method uses has
been deprecated and has a retirement date of September 20, 2023.:
https://twittercommunity.com/t/x-api-v2-migration/203391
"""
return self.request(
'GET', 'geo/search', endpoint_parameters=(
Expand Down

0 comments on commit 935ea8c

Please sign in to comment.