From: Harmon Date: Sat, 19 Dec 2020 10:28:30 +0000 (-0600) Subject: Remove API.update_profile_background_image X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8dba191518366fb756440302eff86d5a868e0306;p=tweepy.git Remove API.update_profile_background_image Resolves #1466 The POST account/update_profile_background_image endpoint has been deprecated and removed, since background profile images have not been available or visible on Twitter.com since July 2015. https://twittercommunity.com/t/upcoming-changes-to-the-developer-platform/104603 --- diff --git a/docs/api.rst b/docs/api.rst index fe57078..7ed53c6 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -601,15 +601,6 @@ Account Methods :rtype: :class:`User` object -.. method:: API.update_profile_background_image(filename) - - Update authenticating user's background image. Valid formats: GIF, JPG, or - PNG - - :param filename: local path to image file to upload. Not a remote URL! - :rtype: :class:`User` object - - .. method:: API.update_profile([name], [url], [location], [description]) Sets values that users are able to set under the "Account" tab of their diff --git a/tests/test_api.py b/tests/test_api.py index d931b53..03783f4 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -217,9 +217,6 @@ class TweepyAPITests(TweepyTestCase): """ def testupateprofileimage(self): self.api.update_profile_image('examples/profile.png') - - def testupdateprofilebg(self): - self.api.update_profile_background_image('examples/bg.png') """ @tape.use_cassette('testupdateprofilebannerimage.yaml', serializer='yaml') diff --git a/tweepy/api.py b/tweepy/api.py index 2ba33f4..48fba3c 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -702,21 +702,6 @@ class API(object): require_auth=True )(self, post_data=post_data, headers=headers) - def update_profile_background_image(self, filename, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_background_image - :allowed_param: 'tile', 'include_entities', 'skip_status', 'use' - """ - f = kwargs.pop('file', None) - headers, post_data = API._pack_image(filename, 800, f=f) - return bind_api( - api=self, - path='/account/update_profile_background_image.json', - method='POST', - payload_type='user', - allowed_param=['tile', 'include_entities', 'skip_status', 'use'], - require_auth=True - )(post_data=post_data, headers=headers) - def update_profile_banner(self, filename, **kwargs): """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner :allowed_param: 'width', 'height', 'offset_left', 'offset_right'